A qmail delivery service handles mail messages in the queue. It runs qmail-send with three companion programs (qmail-lspawn, qmail-rspawn, and qmail-clean) and uses multilog to store log messages. Both qmail-send and multilog are supervised.
Install daemontools 0.70 or above. The following instructions assume that your boot scripts are already running svscan in a /service directory.
Install and configure qmail 1.03. Installing qmail means creating the /var/qmail directory tree. Configuring qmail means setting up some basic control files in /var/qmail/control, setting up some basic aliases in /var/qmail/alias, and setting up /var/qmail/rc. If you have followed the instructions in INSTALL from the beginning through step 8, you must have done all these things.
The following instructions assume that qmail-send is currently not running. If it is running, stop it now. If you have already set up your boot scripts so that they run /var/qmail/rc at boot time, undo the changes.
You will have to make two decisions:
The qmail log account name, normally qmaill. Logging programs run under this account. If this account does not exist, create it now.
The qmail delivery service directory, normally /var/qmail/service/qmail. This is where logs and a few configuration files are stored.
Create the service directory by running the qmail-delivery-conf program:
qmail-delivery-conf qmaill /var/qmail/service/qmail
Look at the qmail-start invocation in /var/qmail/rc. If you have been telling qmail-start to invoke some logging program, change /var/qmail/rc so that qmail-start won't invoke such a program. Typically this means removing a phrase such as ``splogger qmail'' or ``multilog t /var/log/qmail'' from /var/qmail/rc. See the qmail-start(8) manpage for the detail.
Tell svscan about the new service:
ln -s /var/qmail/service/qmail /service
svscan will start the service within five seconds.
Optionally, if you want compatibility with the official qmail documentation, create a symbolic link /var/log/qmail that points to the actual log directory:
cd /var/log test -d qmail && mv qmail qmail.bak ln -s /var/qmail/service/qmail/log/main qmail
Check the service status:
svstat /service/qmail /service/qmail/log
The output should look something like:
/service/qmail: up (pid 6345) 6 seconds /service/qmail/log: up (pid 6346) 5 seconds
Run svstat several times and make sure that the process IDs shown do not change.
Check the log messages:
tail -f /service/qmail/log/main/current | tai64nlocal
The directory /service/qmail/log/main contains log files to which qmail-send stores the log messages. The output should look something like:
status: local 0/10 remote 0/20
qmail-send always prints either ``cannot start'' or ``status''.
Use ps to browse the process tree. It should contain the following portion:
svscan /service supervise qmail qmail-send qmail-lspawn ... qmail-rspawn qmail-clean supervise log multilog t ./main
Two new supervise processes should have been added as svscan's children, one for qmail-send (running as qmails) and the other for multilog (running as qmaill). The process IDs of qmail-send and multilog should match with svstat's output. You will see qmail-send have three children: qmail-lspawn, running as root; qmail-rspawn, running as qmailr; and qmail-clean, running as qmailq. All these processes should be idle at this time.
Follow the instructions in TEST.deliver (in /var/qmail/doc or in the qmail source directory), starting at step 3. Note that the log messages are stored in /service/qmail/log/main/*, not in syslog.