daemontools is a collection of tools for managing UNIX services. It monitors qmail services and saves error messages to one or more logs.


  • Sep 3, 2023
    -Buffer Overflow fixed in timestamp.c (patch multilog-readable_datetime, Ubuntu 22.04). It was causing empty log files. (thanks Bai Borko and KPC)
  • Jun 30, 2023
    -added my multilog_readable-datetime patch which replaces the timestamp in the log lines with a human readable datetime:

    2023-06-28 16:17:26.501272173 tcpserver: status: 0/200/0
    Do not install it if you prefer to stick with the timestamp.
    -if you install this patch you have to download again the convert-multilog program. In case you decide to stick with the original timestamp, then use the original one. (diff)


If you have a working daemontools and have to install the multilog_readable-datetime patch you have to follow these steps:

cd /var/qmail/admin
wget https://notes.sagredo.eu/files/qmail/patches/daemontools/daemontools-0.76-readable_datetime.patch
cd daemontools
patch -p1 < ../daemontools-0.76-readable_datetime.patch
qmailctl reboot

NB: you have to kill the running tcpserver and reboot qmail with qmailctl reboot.

Then download again the convert-multilog program:

rm /usr/local/bin/convert-multilog
wget -O  /usr/local/bin/convert-multilog https://notes.sagredo.eu/files/qmail/convert-multilog

Finally you have to adjust this line in your qmail-smtpd/run/log and qmail-smtpsd/run/log files:

- n5 s16777215 '-*' '+* qlog*' !/usr/local/bin/archive_qmail_qlog $LOGDIRQLOG
+ n5 s16777215 '-*' '+*qlog*' !/usr/local/bin/archive_qmail_qlog $LOGDIRQLOG

note the missing blank space before 'qlog'.


First of all, let's create the folder which will host qmail, daemontools and ucspi-tcp:

mkdir /var/qmail

In this guide I will assume that all the source packages have been downloaded into the /usr/local/src folder.

cd /usr/local/src
wget http://cr.yp.to/daemontools/daemontools-0.76.tar.gz
wget https://notes.sagredo.eu/files/qmail/patches/daemontools/daemontools-0.76.errno.patch
wget https://notes.sagredo.eu/files/qmail/patches/daemontools/multilog_filesize_limit.patch
wget https://notes.sagredo.eu/files/qmail/patches/daemontools/daemontools-0.76-readable_datetime.patch

The multilog_filesize_limit patch (thanks to Sam Tang) extends the file log size limit to 100MB (default is 16MB).

My multilog-readable_datetime patch replaces the timestamp with a human readable datetime. Do not install it if you prefer to stick with the timestamp. Here is what the log lines will look like with the patched daemontools:

@40000000649b607828223d14 tcpserver: status: 0/200/0
will be
2023-06-28 16:17:26.501272173 tcpserver: status: 0/200/0

Install daemontools:

cd /var/qmail
tar xzf /usr/local/src/daemontools-0.76.tar.gz
cd admin
ln -s daemontools-0.76 daemontools
chmod 1755 .

So you have daemontools in /var/qmail/admin/daemontools

Now let's apply the patches and install

cd daemontools
patch -p1 < /usr/local/src/daemontools-0.76.errno.patch
patch -p1 < /usr/local/src/multilog_filesize_limit.patch
patch -p1 < /usr/local/src/daemontools-0.76-readable_datetime.patch

Add the "clear" service, so that you can easily clear the readproctitle service errors line:

cd ../
mkdir clear
touch clear/down

cat > clear/run << __EOF__
yes '' | head -4000 | tr '\n' .

chmod +x clear/run

Finally, since this number of directory levels bothers me:

ln -s /var/qmail/admin/daemontools/command /command

That way, I have almost everything in /var/qmail, except for /command and /service, which are just symbolic links.

Running daemontools at boot time

The command /command/svcscanboot will be added in your /etc/inittab. It will be sufficient to run qmail at boot time.

On systemd based OS the above command has to be added to rc.local in order to be executed at boot time, supposing that rc.local is executed at boot time, or you can choose to create a specific daemontools.service as follows:

cat > /etc/systemd/system/daemontools.service << __EOF__
Description=Daemontools service supervision



systemctl enable daemontools.service
systemctl start  daemontools.service


suggestion to insert install of build-essentials etc on this page.

is it an idea to put the following already here instead of on page installing and configuring vpopmail?:

apt install build-essential autoconf automake libmariadb-dev libmariadb-dev-compat

Reply |

suggestion to insert install of build-essentials etc on this page.

I created a page with the preinstallation tasks, where this and other preliminary tasks are covered. Fill free to post other hints 

Reply |

suggestion to insert install of build-essentials etc on this page.

ok, inserted

Reply |

make: not found

Hi everybody .

i had a problem need your help :

- when i run a command line :

# package/install 

i see : 

Linking ./src/* into ./compile...
Compiling everything in ./compile...
package/compile: 20: exec: make: not found . 

help me , pls .


Reply |

make: not found

I think that you should install autotools. Please refer to your distribution's documentation for the purpose

Reply |

attribute eXecute to "run" file


I´m doing a procedure to install qmail to CentOS 8 (systemd)

run file gets 644 attribute, should we change to 744 ?

Thanks for your work !

Marco Varanda

Reply |

attribute eXecute to


Reply |

Supervise not running on debian

If you receive error: Error supervise not running
It's because daemontools/svscanboot is not starting from sysvinit inittab.

To start from systemd:

cat > /lib/systemd/system/daemontools.service << __EOF__
Description=Daemontools service supervision

ExecStart=/command/svscanboot /etc/service/


systemctl enable daemontools.service
systemctl status daemontools

Reply |

Broken link

qmail.org  is offline, change:

wget http://www.qmail.org/netqmail-1.06.tar.gz


wget https://notes.sagredo.eu/files/qmail/tar/netqmail-1.06.tar.gz

Reply |

patch of multilog file size limit


This is the little multilog patch I would like to share.

By default multilog only support max 16MB log file, for my email server, 16MB only can save 5 hours log, so I made this little patch, and change multilog file limit to 100MB, here how to apply:

cd /usr/local/src
wget https://www.phpini.com/files/multilog_filesize_limit.patch
cd /var/qmail/admin/daemontools
patch -p1 < /usr/local/src/multilog_filesize_limit.patch

and then update log/run file/s, now can assign file size to s104857600 (100MB).

Reply |

patch of multilog file size limit

thank you, Sam.. I'll add it asap

Reply |

clear service

the creation of clear service is non understandeable and not well described

cat > clear/run < 

syntax error near unexpected token `newline'

what must do run to clear ?

no link creation for service clear

Reply |

clear service

thank you, corrected

Reply |

But how do you set the PATH so daemontools can run properly?

I tried installing daemontools exactly as outlined above.  But qmailctl start fails because it can't find svc, svok, etc.  I researched on the web, and it appears that the issue is with daemontools not being found in the PATH.  I've tried updating the path in /etc/profile, and in /etc/inittab (when launching svscan).  Although ps -ef | grep svscan demonstrates that svscan is running, qmailctl can't seem to find scripts in the /command folder.

(Per your suggestion, I'm trying to do this install on Slackware  (version 13.37).)

I also tried running ./rts > rts.out (as mentioned in Dave Sill's book, "Life With Qmail") but it bombs on every line--again complaining 'command not found' one line after the next.

What am I doing wrong?

Thanks in advance for your response.

-Dave Martin

Reply |

Hi Dave, first of all thanks

Hi Dave, first of all thanks a lot for your support.

You should have this PATH inside the /command/svscanboot script:


qmail should start by means of a line inside /etc/inittab


so, you may want to check that svscanboot was actually launched on boot, or try to run it manually. I prefer to have it in my rc.local

fyi, I have tested everything on a slackware64 13.37

cheers :)


Reply |

Daemantools with systemd

if your linux using systemd

remove SV:123456:repawn:/command/svscanboot from /etc/inittab

create a file at /lib/systemd/system/daemontools.service
edit as

Description=DJB daemontools
After=syslog.target network.target



copy links

ln -s /lib/systemd/system/daemontools.service /etc/systemd/system/multi-user.target.wants

reboot ur system

Reply |

I confirmed the settings you gave, but still not working

qmailctl start continues to return errors on line 17: svok: command not found 

However, ps -ef | grep svscan returns the following:

root 1886 1 0 Mar10 ? 00:00:00 /bin/sh /command/svscanboot
root 1948 1886 0 Mar10 ? 00:00:02 svscan /service
root 9379 6093 0 01:12 pts/0 00:00:00 grep svscan

Could there be a permissions issue with the qmail user accounts?  Does the qmail group need to be granted permission to in order to run the daemontool utilities?

Reply |

It's seems like the

It's seems like the daemontools' installation has failed... can you post please:

ls -l /command/
ps axfuww

anyway feel free to contact me in private using the contact button above

Reply |