Runit is a great service supervisor that is used on some Linux distributions. It has been praised in some blogs (, ) for its simplicity and robustness.
On Mac OS X, we have
launchd as init/service supervisor and the goal is not to replace it
with runit, but to launch runit at startup and use it to start other services. In this blog, we
use homebrew to install runit and configure it in order to start user specific
First install runit with
brew install runit. The installation will warn you that runit has
just been installed but not enabled with the following message.
This formula does not install runit as a replacement for init. The service directory is /usr/local/var/service instead of /service. To have runit ready to run services, start runsvdir: runsvdir -P /usr/local/var/service Depending on the services managed by runit, this may need to start as root.
The original runit distribution contains some files and help to configure launchd to
load runit at startup. But these instructions (e.g. like creating a file in
not compatible with Mac OS X El Capitan (as e.g. the folder
/sbin is protected ,
we present here an alternative launchd configuration which consists of modified files from the runit
brew doctorand fix the warnings;
/usr/local/sbinwith the following content: runsvdir-start
org.smarden.runit.plistin the folder
/Library/LaunchDaemonswith the following content: org.smarden.runit.plist.
Load runit in launchd with the following command:
sudo launchctl load /Library/LaunchDaemons/org.smarden.runit.plist
sudo launchctl start org.smarden.runit
Now you have a running runit that will start services for the folder
To allow individual users to run private services, follow these steps:
~/Library/servicethat will hold private services;
runsvdir-<username>in the folder
run executable file of the service folder
runsvdir-<username> with the following content:
#!/bin/sh exec 2>&1 exec chpst -u<username> runsvdir /Users/<username>/Library/service
Load it in runit via the following symlink command:
ln -s /usr/local/var/sv/runsvdir-<username> /usr/local/var/service
SVDIRto point to the private service folder
Now you can symlink services into your private service folder
~/Library/service to let runit start and supervise them.
: Use runit! by Mike Perham
 Process Supervision: Solved Problem by jtimberman
: Ars Technica, El Capitan review
: runit - use with traditional init