Last Updated: 980404

ucspi and daemontools with qmail

Introduction

Many people are probably running qmail with inetd because that's how they had sendmail running before they saw the light. Now it's time to break free of inetd and move to a more flexible, reliable, and powerful setup using ucspi and daemontools.

Your first step is to download, compile, and install these two packages. They may be retrieved from their respective homepages: ucspi and daemontools. They should compile and install fairly easily.

The man pages for each of these programs are clear and simple, and I strongly urge you to read all of them. You now have all the pieces of the puzzle. This document will try to help you see the big picture and put them all together.

tcpserver

The first component we will look at comes from ucspi. tcpserver simply accepts connections and sends them off to another program. It can be configured to control what is accepted and how the program should be ran. You probable have qmail listed in inetd.conf. Comment that line out now. Next, try running tcpserver from the command line (you will need to be root to bind to the smtp port). Straight from the FAQ:

   tcpserver -u 7770 -g 2108 0 smtp /var/qmail/bin/qmail-smtpd &

Replace 7770 with your qmaild uid, and replace 2108 with your nofiles gid. Don't forget the &.

By default, tcpserver allows at most 40 simultaneous qmail-smtpd processes. To raise this limit to 400, use tcpserver -c 400. To keep track of who's connecting and for how long, run (on two lines)

   tcpserver -v -u 7770 -g 2108 0 smtp /var/qmail/bin/qmail-smtpd \
   2>&1 | /var/qmail/bin/splogger smtpd 3 &


ucspi and daemontools with qmail introduction tcpserver tcprules supervise and svc putting it all together