No problem, just wrote a tool for that:
waitport [-u] port [timeout (float)] # -u = UDP instead of TCP
go get github.com/steakknife/my_init/waitport
go build github.com/steakknife/my_init/waitport
# creates waitport bin hereRenamed to https://github.com/steakknife/devops_toolchain
to avoid confusion.
A collection of individual tools that can be cherry-picked to solve nitty-gritty problems.
Runit is great as a tool to manage your own daemons. But as a general init system for distributions? Not so much. Just take a look at the /sbin/my_init system that we wrote for baseimage-docker and what kind of functionality it adds on top of Runit, to give you an idea of why Runit by itself is not enough. Runit also performs no dependency management (i.e. starting one service before another) so it's quite painful in certain situations. For example, if you have a background queue daemon that depends on PostgreSQL, then you have to manually make sure that the daemon is not started until PostgreSQL is available. Otherwise you get tons of useless error messages as your daemon keeps getting restarted.