1
|
1 # -- bash header installed by automake --
|
|
2 #
|
6
|
3 # sm-archive This script controls the sm-archive milter daemon.
|
1
|
4 #
|
|
5 #
|
|
6 # chkconfig: 2345 79 31
|
6
|
7 # description: sm-archive allows adding recipients to mail passing thru this milter
|
|
8 # processname: sm-archive
|
|
9 # pidfile: /var/run/sm-archive.pid
|
1
|
10 # Source function library.
|
|
11 #
|
|
12 . /etc/rc.d/init.d/functions
|
|
13
|
|
14 # Source networking configuration.
|
|
15 . /etc/sysconfig/network
|
|
16
|
|
17 RETVAL=0
|
|
18 # See how we were called.
|
|
19 case "$1" in
|
|
20 start)
|
|
21 # Start daemons.
|
6
|
22 echo -n "Starting sm-archive-milter: "
|
5
|
23 if [ ! -f /var/lock/subsys/smarchive ]; then
|
|
24 cd SYSCONFDIR/sm-archive # conf file is here
|
6
|
25 SBINDIR/smarchive -d 10 -p local:/var/run/sm-archive/sm-archive.sock
|
1
|
26 RETVAL=$?
|
5
|
27 pid=`pidof -s SBINDIR/smarchive`
|
1
|
28 if [ $pid ]
|
|
29 then
|
6
|
30 success "Starting sm-archive milter:"
|
5
|
31 touch /var/lock/subsys/smarchive
|
1
|
32 echo
|
|
33 else
|
6
|
34 failure "Starting sm-archive milter:"
|
1
|
35 echo
|
|
36 fi
|
|
37 else
|
|
38 echo -n "already running! "
|
6
|
39 failure "sm-archive milter already running!"
|
1
|
40 echo
|
|
41 fi
|
|
42
|
|
43 ;;
|
|
44 stop)
|
|
45 # Stop daemons.
|
6
|
46 echo -n "Shutting down sm-archive-milter: "
|
5
|
47 killproc smarchive
|
1
|
48 RETVAL=$?
|
|
49 echo
|
5
|
50 [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/smarchive
|
1
|
51 ;;
|
|
52 restart|reload)
|
|
53 $0 stop
|
|
54 $0 start
|
|
55 RETVAL=$?
|
|
56 ;;
|
|
57 status)
|
5
|
58 status smarchive
|
1
|
59 RETVAL=$?
|
|
60 ;;
|
|
61 *)
|
6
|
62 echo "Usage: sm-archive {start|stop|restart|status}"
|
1
|
63 exit 1
|
|
64 esac
|
|
65 exit $RETVAL
|
|
66
|
|
67 # $Id$
|