Normally this is done by either adding an entry for /sbin/runsvdir-start to /etc/inittab, or by adding /sbin/runsvdir-start as command to /etc/rc.local, or by adding /sbin/runsvdir-start to the system's StartupItems.
In any case, you first need to copy the stage 2 script to /sbin/runsvdir-start, and create the services directory /service/:
# install -m0750 /package/admin/runit/etc/2 /sbin/runsvdir-start # mkdir -p /service
# cat >>/etc/inittab <<EOT SV:123456:respawn:/sbin/runsvdir-start EOTand tell init to re-read its configuration, e.g.:
# init q
# cat >/etc/init/runsvdir.conf <<\EOT # for runit - manage /usr/sbin/runsvdir-start start on runlevel 2 start on runlevel 3 start on runlevel 4 start on runlevel 5 stop on shutdown respawn exec /usr/sbin/runsvdir-start EOTand tell init to start the new service, e.g.:
# start runsvdir
# cat >>/etc/rc.local <<EOT csh -cf '/sbin/runsvdir-start &' EOTand reboot your system.
# cd /System/Library/StartupItems # mkdir -p runit # cp -p /package/admin/runit/etc/macosx/StartupItems/* runit/and reboot your system.
On MacOSX 10.4 create an entry for runit in /Library/LaunchDaemons/, and tell launchd to start the new service:
# cp /package/admin/runit/etc/macosx/org.smarden.runit.plist \ /Library/LaunchDaemons/ # launchctl load /Library/LaunchDaemons/org.smarden.runit.plist