Installing Daemontools

Daemontools is a small set of very useful utilities, from Dan Bernstein. They are mainly used for controlling processes, and maintaining logfiles. For more information, please see http://cr.yp.to/daemontools.html

PLEASE NOTE: If you have already installed TinyDNS in this guide, please proceed to the next step!


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

If you get a pop-up window when you do this, Just hit TAB and then click OK.

We now need to create the /service directory to get svscan running. We do that by: 


# mkdir /service

You will now want to start the svscan server by running:


# csh -cf '/usr/local/bin/svscanboot &'

If you run ps -auxw | grep svscan, you will or should see something like this:


root 384 0.0 0.0 1652 8 con- I 16Jul05 0:00.01 /bin/sh /command/svscanboot
root 404 0.0 0.0 1244 140 con- S 16Jul05 9:04.68 svscan /service

We now need to tell FreeBSD to start daemontools on startup. Here is the command that tells freebsd to do that:


# echo "csh -cf '/usr/local/bin/svscanboot &'" >> /etc/rc.local

Before we continue on, we want to delete the startup script thats created when we installed daemontools:


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

Now that daemontools is running, we are all done!

Understanding Daemontools

Daemontools controls all the services that run in /services. You can stop, start and restart these services. You can also get status on all the services as follows:

This command restarts /service/qmail-smtpd/log


svc -t /service/qmail-smtpd/log

This command stops /service/qmail-pop3d


svc -d /service/qmail-pop3d

This command starts /service/qmail-send


svc -u /service/qmail-send

This command gives you the status of all the services and logs


svstat /service/* /service/*/log

Thats just a few examples of how to use services. This can and WILL be useful for qmail troubleshooting. Please see How to use services and look at logs for more information.

Installing EZMLM-IDX