Guide updated on 29th of February 2016

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/log
mkdir -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/service-qmail-send-run /var/qmail/supervise/qmail-send/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/run
chmod 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/service
ln -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

I've downloaded the sofwares bundle in Pre-step 4 section I've downloaded each software individually from original locations in Pre-step 4 section

Color Coded Qmail Installation Key
  Regular Black Text     Qmail installation notes and summaries by the author.
  Bold Black Text     Commands to be run by you, the installer.
  Bold/Regular Red Text    Vital and/or critical information.
  Regular Blue text     Denotes helpful tips and hints or hyperlinks.
  Regular Orange Text     Command line output.
  Bold/Regular green text     Denotes the contents of a file or script.