Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I determine whether my services are using runit or init? I use Ubuntu 10.0.4.

Such as nginx, chef, puppet, etc.

share|improve this question

pstree gives me processes as below,

$ pstree
     |          |-runsv---java---9*[{java}]                                                            
     |          `-runsv                                                                                

With this, I think, it can be decided.

share|improve this answer

I'm not completely sure, but since runit uses a supervisor, you should be able to recognize it from looking at the process tree, i.e. from the output of ps faux or, if it's installed, pstree.

You could also just ask runit, i.e. run sv status nginx.

Note however that if all you did was install runit, possibly nothing got switched to use it instead of "plain" init. You can examine /proc/cmdline for an occurrence of init=/sbin/runit-init.

share|improve this answer

If you need your services to have a common control interface, it may be better to mimic init.d script behavior with sv command. If sv is called as a /etc/init.d/NAME command, it automatically translates this to sv command NAME.

If you run some service (let's say ssh) under runit supervisor, you can do the following:

  1. Rename current init script:

    dpkg-divert --rename /etc/init.d/ssh
  2. Create symlink with the same name:

    ln -vs $(which sv) /etc/init.d/ssh

Now you can manage your service with familiar commands like this:

/etc/inti.d/ssh status
invoke-rc.d ssh status

Having symlink will cause some complaints about LSB-headers, though. So it's even better not to have symlink, but to create a wrapper script like this:


# copy these headers from your original script which
    # can be found at /etc/init.d/ssh.distrib

exec /usr/bin/chpst -b $0 /usr/bin/sv "$@"

This way you can manage services the same way, whether they're being under runit or not.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.