Configure Daemontools
Daemontools is a collection of Unix tools for managing services. Its home page is here: http://cr.yp.to/daemontools.html
If you don't want to read about it, just remember that it allows to automatically restart a crashing service (but it allows a lot of other things and I really advice you to read about it...)
It has already been installed with a Debian package at this step
In this guide version, we'll use it only to manage the processes qmail-smtpd, qmail-send and qmail-smtpdssl. I however plan to manage other services in a next release.
Create the needed directories with appropriates permissions
mkdir -p /var/qmail/supervise/qmail-smtpd/logmkdir -p /var/qmail/supervise/qmail-send/log
mkdir -p /var/qmail/supervise/qmail-smtpdssl/log
mkdir -p /var/qmail/supervise/courierpassd/log
cd /var/qmail/supervise
chmod +t qmail-smtpd qmail-send qmail-smtpdssl courierpassd
Copy the scripts to their proper locations
(service-qmail-send-run,send_log,service-qmail-smtpd-run,smtpd_log,service-qmail-smtpdssl-run,smtpdssl_log,service-courierpassd-run,service-any-log-run)
cp /downloads/scripts/send_log /var/qmail/supervise/qmail-send/log/run
cp /downloads/scripts/service-qmail-smtpd-run /var/qmail/supervise/qmail-smtpd/run
cp /downloads/scripts/smtpd_log /var/qmail/supervise/qmail-smtpd/log/run
cp /downloads/scripts/service-qmail-smtpdssl-run /var/qmail/supervise/qmail-smtpdssl/run
cp /downloads/scripts/smtpdssl_log /var/qmail/supervise/qmail-smtpdssl/log/run
cp /downloads/scripts/service-courierpassd-run /var/qmail/supervise/courierpassd/run
cp /downloads/scripts/service-any-log-run /var/qmail/supervise/courierpassd/log/run
Adapt permissions
chmod 751 /var/qmail/supervise/qmail-smtpd/runchmod 751 /var/qmail/supervise/qmail-smtpd/log/run
chmod 751 /var/qmail/supervise/qmail-send/run
chmod 751 /var/qmail/supervise/qmail-send/log/run
chmod 751 /var/qmail/supervise/qmail-smtpdssl/run
chmod 751 /var/qmail/supervise/qmail-smtpdssl/log/run
chmod 751 /var/qmail/supervise/courierpassd/run
chmod 751 /var/qmail/supervise/courierpassd/log/run
Create symlinks in /etc/service directory
ln -s /var/qmail/supervise/qmail-send /var/qmail/supervise/qmail-smtpd /etc/serviceln -s /var/qmail/supervise/qmail-smtpdssl /var/qmail/supervise/courierpassd /etc/service
Create a symlink from Debian convention to standard convention
ln -s /etc/service /service