Daemontools

General Information

This guide will help you set up Dan Bernstein’s daemontools, which is a program that supervises another daemon so that when it does fail, it will automatically be restarted.

Requirements

You will need the following items to be able to complete this guide:

  1. Root access to a FreeBSD machine
  2. FreeBSD install with ports up-to-date

Compiling

This is where your up-to-date ports come in handy.

# cd /usr/ports/sysutils/daemontools
# make install

Setting up daemontools

There is not much to do. Create a directory, and then we also need to add an entry to /etc/rc.conf to tell it that we want to start svscan as the master process is called upon booting.

# mkdir /var/service
# echo 'svscan_enable="YES"' >> /etc/rc.conf

Starting svscan

There are two ways that you can start svnscan. Reboot your system, or execute its rc file.

# /usr/local/etc/rc.d/svscan.sh start

It should now be running. To see if it really is running, check with ps.

# ps auxwwww | grep svscan

You should see /usr/local/bin/svscan running. Congratulations, you successfully got daemontools running.

Speak Your Mind

*