I'm having problems with qmail-smtpd dying on my Solaris box. It is running
under tcpserver/supervise but this doesn't seem to prevent it from dying and
not restarting.
For example:
bbsol01:/root $ telnet localhost 25
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
bbsol01:/root $ svstat /var/lock/qmail-smtpd
944896613 up pid 24864
bbsol01:/root $ svc -d /var/lock/qmail-smtpd
svc: warning: unable to control /var/lock/qmail-smtpd: device not configured
bbsol01:/root $ ps -ef|grep qmail-smtpd
bbsol01:/root $ /etc/init.d/qmail-smtpd.init start
DIR = /var/lock/qmail-smtpd
-n Starting qmail-smtpd...
done
bbsol01:/root $ ps -ef|grep qmail-smtpd
qmaill 26336 1 0 03:43:01 pts/1 0:00 cyclog -s 1000000
/var/log/qmail-smtpd
root 26337 26336 0 03:43:01 pts/1 0:00 supervise
/var/lock/qmail-smtpd tcpserver -v -c40 -x /etc/tcprules.d/qmail-smtp
qmaild 26338 26337 0 03:43:01 pts/1 0:00 tcpserver -v -c40 -x
/etc/tcprules.d/qmail-smtpd.cdb -u102 -g100 0 smtp qmail-s
bbsol01:/root $ telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
exit
220 bbsol01.dedicated-services.com ESMTP
221 bbsol01.dedicated-services.com
Connection closed by foreign host.
As you can see, svc thinks that qmail-smtpd is up when it isn't. There
isn't anything in the logs that gives any indication of what may be
happening, and I can't see any pattern to the problem. I suspect it may be
a server load problem as the box gets pretty heavily loaded by an apache
installation hosting some sort of chat service which runs as a java servlet.
The contents of /etc/init.d/qmail-smtpd.init are at the end of this mail.
For the record, it's qmail-1.03, ucspi-tcp-0.84, daemontools-0.53,
vpopmail-3.4.10.
Has any one got any idea what might be causing this, or how I can go about
finding out?
Thanks for any suggestions.
R.
#! /sbin/sh
# $INITDIR/qmail-smtpd.init
# INITDIR is defined below
# Sun Dec 14 1997 XZ <[EMAIL PROTECTED]> v2.3
# chkconfig: 345 81 46
# description: Start, stop, restart, reload, and otherwise \
# signal qmail-smtpd. \
# Makes heavy use of parts of DJB's daemontools package \
# It also relies upon daemontools.functions for 91.04982% \
# of the grunt work.
#
# [EMAIL PROTECTED]:
# small fixes and modifications
# customize
QMAILHOME=/var/qmail # ~qmail
USERID=`/usr/xpg4/bin/id -u qmaild` # UID to run with
GROUPID=`/usr/xpg4/bin/id -g qmaild` # GID to run with
PROG=qmail-smtpd # what program?
COMMAND=$PROG # command to start $PROG
DIR=/var/lock/$PROG # directory for supervise
LOGDIR=/var/log/$PROG # directory to log to
LOGUSER=qmaill # user to own logs
LOGSIZE="-s 1000000" # size of logfile
CDB=/etc/tcprules.d/$PROG.cdb # rules file
CONCURRENT=40 # number of concurrent connections
# (40 is the default of tcpserver)
PORT=smtp # port to watch
VERBOSE=-v # use verbose option to tcpserver
INITDIR=/etc/init.d
# Grab the daemontools init functions
. $INITDIR/daemontools.functions
PATH=$QMAILHOME/bin:$PATH
#USERID=`id -u qmaild` # UID to run with
#GROUPID=`id -g qmaild` # GID to run with
start() {
if check; then
echo "$PROG is already running"
else
echo -n "Starting $PROG..."
if [ -r $CDB ] ; then
supervise $DIR \
tcpserver $VERBOSE -c$CONCURRENT -x $CDB -u$USERID -g$GROUPID 0
$PORT $COMMAND \
2>&1| setuser $LOGUSER accustamp \
| setuser $LOGUSER cyclog $LOGSIZE $LOGDIR &
else
supervise $DIR \
tcpserver $VERBOSE -c$CONCURRENT -u$USERID -g$GROUPID 0 $PORT
$COMMAND \
2>&1 | setuser $LOGUSER accustamp \
| setuser $LOGUSER cyclog $LOGSIZE $LOGDIR &
fi
echo "done"
fi
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
status)
status
;;
help)
help
;;
*)
signal $1
;;
esac