CVS: moonbase/mail/sendmail/init.d sendmail,1.2,1.3
sofar at lunar-linux.org
sofar at lunar-linux.org
Sun Sep 7 20:45:00 GMT 2003
Update of /var/cvs/lunar/moonbase/mail/sendmail/init.d
In directory dbguin.lunar-linux.org:/tmp/cvs-serv9403
Modified Files:
sendmail
Log Message:
Should fix the problems... cause: new pidfile code of sendmail, yeck!
Index: sendmail
===================================================================
RCS file: /var/cvs/lunar/moonbase/mail/sendmail/init.d/sendmail,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- sendmail 31 Mar 2003 08:54:50 -0000 1.2
+++ sendmail 7 Sep 2003 20:44:58 -0000 1.3
@@ -17,8 +17,49 @@
}
start () {
- newaliases
- default_start
+ if [ -f /etc/mail/aliases ] ; then
+ newaliases
+ fi
+ if [ -f /etc/mail/virtusers ] ; then
+ makemap hash /etc/mail/virtusers.db < /etc/mail/virtusers
+ fi
+ if [ -f /etc/mail/genericstable ] ; then
+ makemap hash /etc/mail/genericstable.db < /etc/mail/genericstable
+ fi
+ if [ -f /etc/mail/access ] ; then
+ makemap hash /etc/mail/access.db < /etc/mail/access
+ fi
+ echo -n "Starting sendmail: "
+ if [ -f $PIDFILE ] ; then
+ echo -e "$PIDFILE exists!$RESULT_FAIL"
+ exit 1
+ fi
+ if $(/bin/pgrep -P 1 sendmail &> /dev/null) ; then
+ echo -e "Already running$RESULT_FAIL"
+ exit 1
+ fi
+ /usr/sbin/sendmail $ARGS &&
+ echo -e $RESULT_OK ||
+ echo -e $RESULT_FAIL
+}
+
+stop () {
+ echo -n "Stopping sendmail: "
+ if [ -f $PIDFILE ] ; then
+ PID=$(head -1 $PIDFILE)
+ if [ -d /proc/$PID ] ; then
+ if kill -TERM $PID ; then
+ rm $PIDFILE
+ echo -e $RESULT_OK
+ else
+ echo -e "kill failed$RESULT_FAIL"
+ fi
+ else
+ echo -e "can't find PID$RESULT_FAIL"
+ fi
+ else
+ echo -e "can't find PID$RESULT_FAIL"
+ fi
}
. /lib/lsb/init-functions
More information about the Lunar-commits
mailing list