The -bD command-line
switch is almost exactly the same as the -bd
switch. That is, it causes sendmail to run as a
daemon, but unlike the -bd switch, it prevents
sendmail from performing a
fork(2) and thereby keeps
sendmail in the foreground. The
-bD switch also prevents detaching from the
controlling terminal (just as does the -d99.100
debugging switch, -d99.100).
This -bD command-line switch allows
sendmail to be run from a
"wrapper" scriptfor example,
to detect whether it died or was killed:
#!/bin/sh
SENDMAIL=/usr/sbin/sendmail
UCBMAIL=/usr/ucb/mail
if [ -f $SENDMAIL -a -f $UCBMAIL ]
then
$SENDMAIL -bD -q1h
echo ${SENDMAIL}, which should run forever, died \
| $UCBMAIL -s "Sendmail died" root
fi
Note that the echo line will never be reached as
long as sendmail continues to run. Also note
that you will not be able to restart sendmail in
the usual manner with a SIGHUP if you use this script.