3 # sendmail This shell script takes care of starting and stopping
6 # chkconfig: 2345 80 30
7 # description: Sendmail is a Mail Transport Agent, which is the program \
8 # that moves mail from one machine to another.
9 # pidfile: /var/run/sendmail.pid
12 # Source function library
13 . /etc/rc.d/init.d/functions
16 . /etc/sysconfig/network
19 if [ -f /etc/sysconfig/sendmail ]; then
20 . /etc/sysconfig/sendmail
27 # Check that networking is up.
28 if is_no "${NETWORKING}"; then
29 msg_network_down Sendmail
33 # See how we were called.
36 # Check if the service is already running?
37 if [ ! -f /var/lock/subsys/sendmail ]; then
38 show "Prepare sendmail db"
40 /usr/bin/newaliases >/dev/null 2>&1
41 for i in virtusertable access domaintable mailertable; do
42 if [ -f /etc/mail/$i ] ; then
43 makemap -v hash /etc/mail/$i < /etc/mail/$i >/dev/null 2>&1
48 daemon /usr/sbin/sendmail $([ "$DAEMON" = "yes" ] && echo -bd) \
49 $([ -n "$QUEUE" ] && echo -q$QUEUE) \
50 $([ "$ENABLE_IPV6" = "yes" ] &&
51 echo -ODaemonPortOptions=Family=inet6 )
53 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/sendmail
55 msg_already_running sendmail
64 [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sendmail
71 if [ -f /var/lock/subsys/sendmail ]; then
82 echo "Usage: sendmail {start|stop|restart|reload|condrestart|status}"