Runit is a process supervisor. It includes runit-init, which can replace sysv's init as pid1, or can be run from inittab or your init system of choice.
Runit's simple collection of tools can be used to build flexible dependency structures and distributed systems, or blazing fast parallel runlevel changes (including the initial boot).

See G. Pape's Runit Page for a complete description, but follow the installation instructions below for your Arch system.

Contents

Installation

To replace init with runit-init

install runit-run-git from the AUR

choose/create a default runlevel (see Run Levels)

reboot

If you just want to get your feet wet and not replace init just yet,
runit-dietlibc can be installed side-by-side with the regular Arch initscripts, providing just process supervision of those services you put in /var/service.

While in run level 2, you are not contstrained to any amount service levels (equivalent to runlevels in sysvinit). You can runschdir to any directory (full of service directory symlinks) you've made in /etc/runit/runsvdir/.
This becomes very handy in cases where you have an HA (Failover) setup, and you have one machine that can take over services for many other machines, simply by runsvchdir <theservicedir>.

You can also run trees of dependent service levels by having user-level supervision directories. See User Level Services below.

By default, the runit-run-git packages uses a very minimal service set, defined in /etc/runit/runsvdir/runit-default and symlinked to /etc/runit/runsvdir/default.

It only gives gettys on tty2 and tty3, so you will boot to just console scroll and a tidy 'runsvchdir: default: current'. This means when you start X it will be on tty4.

To go back to the standard arch consoles, use the arch-default directory in /etc/runit/runsvdir (symlink it to /etc/runit/runsvdir/default). Better yet, create your own directory in /etc/runit/runsvdir and add the symlinks you want for just the services you desire. Remember to take any services you start with runit out of DAEMONS in /etc/rc.conf, they don't need to be started there, and runit will allow parallel startup without backgrounding them.

General Use

For convenience I'll be using /service as the service directory in these examples. Since this has not been accepted by FHS, it is only made available as a symlink in the runit-run-git package. This allows importing of /service scripts written by others without as much fuss. If you only install runit-dietlibc, you would use /var/service as your service directory, or make the /service symlink to /var/service yourself.

Services should live in /etc/sv; however, the runit-scripts package puts a bunch of common ones in /etc/runit/runsvdir/all. We're working to replace/convert these to /etc/sv in the runit-services-git package.

We've symlinked /sbin/runit-init to /sbin/init in runit-run-git, so as not to have to change grub stuff. The original sysvinit can be started (even after a runit-run-git install) with init=/sbin/init.sysv appended to your kernel command line.

User Level Services

You can extend the supervision tree by starting a runsvdir as a specific user, giving that user control of their own supervise tree.

Replace the 'stumpwm' with the command to launch your window manager or desktop environment.

Requires the 'keychain' and 'ssh-askpass-fullscreen' packages, or you could replace 'eval $(keychain)' with 'eval $(ssh-agent) and replace ssh-askpass-fullscreen with any ssh passphrase asker.
The fullscreen version guarantees protection of your desktop, so we prefer that. This also exports your key to all your x apps,
so you don't need another keychain manager for ssh. In addition, 'keychain' (as opposed to just ssh-agent) supports gpg passphrase caching, as well, not
just the ssh keys.