]> git.pld-linux.org Git - packages/sendmail.git/blob - sendmail.init
- added full sendmail daemon path
[packages/sendmail.git] / sendmail.init
1 #! /bin/sh
2 #
3 # sendmail      This shell script takes care of starting and stopping
4 #               sendmail.
5 #
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
10
11
12 # Source function library
13 . /etc/rc.d/init.d/functions
14
15 # Get network config
16 . /etc/sysconfig/network
17
18 # Get service config
19 [ -f /etc/sysconfig/sendmail ] && . /etc/sysconfig/sendmail
20
21 # Check that networking is up.
22 if is_no "${NETWORKING}"; then
23         msg_Network_Down Sendmail
24         exit 1
25 fi
26
27 # See how we were called.
28 case "$1" in
29   start)
30         # Check if the service is already running?
31         if [ ! -f /var/lock/subsys/sendmail ]; then
32                 show "Prepare sendmail db"
33                 busy
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
38                         fi
39                 done 
40                 deltext;ok
41                 msg_starting sendmail
42                 daemon /usr/sbin/sendmail $SENDMAIL_CF
43         else
44                 msg_Already_Running sendmail
45                 exit 1
46         fi
47         touch /var/lock/subsys/sendmail
48         ;;
49   stop)
50         # Stop daemons.
51         msg_stopping sendmail
52         killproc sendmail
53         rm -f /var/lock/subsys/sendmail
54         ;;
55   restart|reload)
56         $0 stop
57         $0 start
58         ;;
59   status)
60         status sendmail
61         ;;
62   *)
63         msg_Usage "$0 {start|stop|staus|restart|reload}"
64         exit 1
65 esac
66
67 exit 0
68
This page took 0.028417 seconds and 3 git commands to generate.