Sunday, April 13, 2008

Configuring Daemontools under Ubuntu (upstart)

With the moving of ubuntu from the old fashioned init to the modern upstart, the daemontools svscanboot package doesn't cleanly install. Here's how to fix it. You really do need daemontools if you're going to run djbdns or qmail.

The daemontools-installer package modifies /etc/inittab to cause the svscan/svscanboot process to launch. With upstart, there is no /etc/inittab, instead it is replaced with a collection of config files in /etc/event.d. There's currently a bug for this misbehavior, however it is over a year old, but has the workaround documented.

The solution is to first create an empty, bogus /etc/inittab, then run the installer, and then put a manually created file in /etc/event.d to actually launch svscan.

  1. Create a bogus inittab, touch /etc/inittab

  2. Install the installer, apt-get install daemontools-installer

  3. Fetch the code, get-daemontools

  4. Build the package, build-daemontools (and, of course, install it when prompted)

  5. Create /etc/event.d/svscan

  6. Run initctl start svscan

  7. If desired, rm /etc/inittab

The following is the contents of /etc/event.d/svscan:

start on runlevel 2
start on runlevel 3
start on runlevel 4
start on runlevel 5
stop on shutdown
exec /usr/bin/svscanboot

Now you will get the desired behavior of svscan starting at boot and being kept running by upstart.

No comments:

Post a Comment