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 [ -f /etc/sysconfig/sendmail ] && . /etc/sysconfig/sendmail
21 # Check that networking is up.
22 if is_no "${NETWORKING}"; then
23 msg_Network_Down Sendmail
27 # See how we were called.
30 # Check if the service is already running?
31 if [ ! -f /var/lock/subsys/sendmail ]; then
32 show "Prepare sendmail db"
34 newaliases >/dev/null 2>&1
35 for i in virtusertable access domaintable mailertable; do
36 if [ -f /etc/mail/$i ] ; then
37 makemap -v hash /etc/mail/$i < /etc/mail/$i >/dev/null 2>&1
42 daemon /usr/sbin/sendmail $SENDMAIL_CF
44 msg_Already_Running sendmail
47 touch /var/lock/subsys/sendmail
53 rm -f /var/lock/subsys/sendmail
63 msg_Usage "$0 {start|stop|staus|restart|reload}"