qmail with daemontools - smtpd shtudown problem

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 ...


Go Back   Usenet Forums > Mail Servers and Related > alt.comp.mail.qmail

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-28-2003
Matt Simpson
 
Posts: n/a
Default qmail with daemontools - smtpd shtudown problem

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?
Reply With Quote
  #2 (permalink)  
Old 11-29-2003
Jonathan de Boyne Pollard
 
Posts: n/a
Default Re: qmail with daemontools - smtpd shtudown problem

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.
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 01:11 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0