This is a discussion on qmail with daemontools - smtpd shtudown problem within the alt.comp.mail.qmail forums, part of the Mail Servers and Related category; I'm running qmail-smtpd with tcpserver and daemontools (and rblsmtpd). I have everything set up so that svscan starts ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I'm running qmail-smtpd with tcpserver and daemontools (and rblsmtpd).
I have everything set up so that svscan starts qmail-smptd at boot time. But I can't shut it down with svc -d. The "run" task exits, but the tcpserver and splogger tasks keep running. My /service/qmail-smtpd/run script is: #!/bin/sh QMAILDUID=`id -u qmaild` NOFILESGID=`id -g qmaild` LOCAL=`head -1 /var/qmail/control/me` exec /usr/local/bin/softlimit -m 2000000 \ /usr/local/bin/tcpserver -v -u "$QMAILDUID" -g "$NOFILESGID" \ -R -l "$LOCAL" -x /etc/tcprules/cdb 0 smtp \ /usr/local/bin/rblsmtpd \ -r cbl.abuseat.org \ -r sbl.spamhaus.org -r list.dsbl.org \ -r 'dnsbl.njabl.org:Message from %IP% rejected - see see http://njabl.org/' \ /var/qmail/bin/qmail-smtpd 2>&1 | /usr/local/bin/splogger smtpd 2 After boot, a ps list shows USER PID PPID PGID SESS JOBC STAT TT TIME COMMAND root 32239 1 32239 c2d4aec0 0 SJ ?? 0:00.01 /usr/local/bin/svscan /var/service/ root 32246 32239 32239 c2d4aec0 0 SJ ?? 0:00.00 supervise qmail-smtpd root 32249 32246 32239 c2d4aec0 0 IWJ ?? 0:00.00 /bin/sh ../run qmaild 32259 32249 32239 c2d4aec0 0 IWJ ?? 0:00.00 (tcpserver) root 32260 32249 32239 c2d4aec0 0 IJ ?? 0:00.00 /usr/local/bin/splogger smtpd 2 after issuing svc -d qmail-smtpd (from within the /service directory) ps list shows USER PID PPID PGID SESS JOBC STAT TT TIME COMMAND root 32239 1 32239 c2d4aec0 0 SJ ?? 0:00.02 /usr/local/bin/svscan /var/service/ root 32246 32239 32239 c2d4aec0 0 IJ ?? 0:00.01 supervise qmail-smtpd qmaild 32259 1 32239 c2d4aec0 0 IWJ ?? 0:00.00 (tcpserver) root 32260 1 32239 c2d4aec0 0 IJ ?? 0:00.00 /usr/local/bin/splogger smtpd 2 The run task is gone, but the tcpserver and splogger tasks are still running, and their parent id has changed. Any suggestions on how to fix this? |
|
|||
|
MS> But I can't shut it down with svc -d.
That's because you are mis-using "daemontools". "supervise" expects its child process to be the actual daemon process being supervised. When it terminates the daemon, it sends a signal to its child. However, your script creates a pipeline, and thus the child process of "supervise" is a shell, with the actual daemon process being one of the grandchildren of "supervise". Get rid of the silly "splogger" stuff and the pipeline, and use the more reliable logging facility that "daemontools" itself provides. If you'd followed the directions in _Life With "qmail"_, which show how to use the "daemontools" logging facility, you wouldn't be having the problem that you are having now. |