Running Daemontools under Ubuntu 8.10
Daemontools is a collection of tools that help keep manage processes. It's great for keeping daemons running - if they ever die then Daemontools just restarts them. Unfortunately the package for Ubuntu is a little broken because it relies on /etc/inittab
and Ubuntu hasn't used this file for a long time. Here's how install Daemontools and fix the problem.
Installing Daemontools
This bit is easy.
sudo apt-get install daemontools
Daemontools is installed. Easy, huh? Unfortunately it won't start after a reboot. That's bad. The daemontools-run
package was meant to make Daemontools start at system bootup but unfortunately it relies on a system that uses init... and Ubuntu doesn't. It uses upstart instead.
Make Daemontools run at system startup
Create the file /etc/event.d/svscanboot
with the following content.
start on runlevel 2
start on runlevel 3
start on runlevel 4
start on runlevel 5
stop on runlevel 0
stop on runlevel 1
stop on runlevel 6
respawn
exec /usr/bin/svscanboot
You'll also need to mkdir /etc/service
since this is where the Ubuntu-installed Daemontools looks for service definitions.
Now tell the system to start the process.
sudo initctl start svscanboot
Other distributions
Plenty of other distributions use upstart instead of init. Getting DaemonTools running on them is pretty similar.
curl -LO http://barkingiguana.com/2008/11/28/running-daemontools-under-ubuntu-810.html.orig
curl -LO http://barkingiguana.com/2008/11/28/running-daemontools-under-ubuntu-810.html.orig.asc
gpg --verify running-daemontools-under-ubuntu-810.html.orig{.asc,}
If you'd like to have a conversation about this post, email craig@barkingiguana.com. I don't bite.