comparison sm-archive.rc @ 5:b8a3b366635a

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