[Mimedefang] OT: Sendmail Startup Script
Stephane Lentz
Stephane.Lentz at ansf.alcatel.fr
Fri Aug 23 16:44:01 EDT 2002
On Fri, Aug 23, 2002 at 03:53:24PM -0400, Rich West wrote:
> >
> >
> >>So, I am now running Sendmail, and a queue control process. But what do I
> >>do in the stop part?
> >>
> >>
> >
> >Ugly, isn't it? The sendmail.org people screwed up; they should start
> ...
> IMHO, for simplicity, simply call killproc twice. You have two
> processes, and killproc kills just one, so call it once for each
> process. And the following code will do that. (note that the start
> portion of the init script starts the queue-runner AFTER sendmail is
> started, so the ordering of the killproc in the snippet below kills them
> in the same order)
>
>
> stop)
> # Stop daemons.
> echo -n "Shutting down sendmail: "
> killproc sendmail
> RETVAL=$?
> echo
> [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sendmail
> killproc sendmail
> RETVAL=$?
> echo
> [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sendmail.smmsp
> ;;
>
The latest sendmail 8.12.5 RedHat RPM in RawHide provides some good
init script.
In the submit.mc they added :
define(`confPID_FILE', `/var/run/sm-client.pid')dnl
In the stop) init part they put :
stop() {
# Stop daemons.
echo -n "Shutting down %s: " "$prog"
killproc sendmail
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sendmail
if test -f /var/run/sm-client.pid ; then
echo -n "Shutting down sm-client: "
killproc sm-client
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/run/sm-client.pid
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sm-client
fi
return $RETVAL
}
The start part includes :
daemon --check sm-client /usr/sbin/sendmail -L sm-msp-queue -Ac \
$([ -n "$QUEUE" ] && echo -q$QUEUE)
SL/
---
Stephane Lentz / Alcanet International - Internet Services
More information about the MIMEDefang
mailing list