You can create `down` files in the service dirs as described in [1]
and enable the services from a script at boot time.

[1]: http://smarden.org/runit/runsv.8.html

On 4 June 2015 at 22:41, Jameson Graef Rollins
<jroll...@finestructure.net> wrote:
> Hi, all.  I am using runit to supervise a large set of nearly identical
> processes.  Each process accesses certain IO-bound shared resources
> (e.g. NFS mount) at startup.  At system initialization, when runsvdir is
> launched, it launches all these processes (via runsv) essentially
> simultaneously.  This causes a big resource contention at initialization
> that occasionally causes problems.
>
> What I would like is to somehow stagger the startup of the processes, to
> avoid the resource contention.  I could do this by putting a random
> sleep into the ./run scripts, but this would also cause random startup
> delays on subsequent process restarts via "sv restart" or the like
> (which we occasionally need to do).
>
> What I would prefer instead is to add random delays to the startup of
> the *runsv* processes, since this would only apply at system
> initialization.  Unfortunately I can't see any way to do that right now
> (other than somehow wrapping the runsv binary itself).
>
> Does anyone know any way to accomplish what I'm looking for?  I don't
> believe runsvdir supports any options that would apply here.  Is it
> possible to somehow point runsvdir to a alternate runsv executable to
> which I could add the random delays?
>
> Any suggestions would be much appreciated.  Thanks.
>
> jamie.

Reply via email to