comparison sm-archive.rc @ 6:0b03e7656abf

initial version
author carl
date Fri, 10 Mar 2006 12:14:57 -0800
parents b8a3b366635a
children
comparison
equal deleted inserted replaced
5:b8a3b366635a 6:0b03e7656abf
1 # -- bash header installed by automake -- 1 # -- bash header installed by automake --
2 # 2 #
3 # smarchive This script controls the smarchive milter daemon. 3 # sm-archive This script controls the sm-archive milter daemon.
4 # 4 #
5 # 5 #
6 # chkconfig: 2345 79 31 6 # chkconfig: 2345 79 31
7 # description: smarchive allows adding recipients to mail passing thru this milter 7 # description: sm-archive allows adding recipients to mail passing thru this milter
8 # processname: smarchive 8 # processname: sm-archive
9 # pidfile: /var/run/smarchive.pid 9 # pidfile: /var/run/sm-archive.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 smarchive-milter: " 22 echo -n "Starting sm-archive-milter: "
23 if [ ! -f /var/lock/subsys/smarchive ]; then 23 if [ ! -f /var/lock/subsys/smarchive ]; then
24 cd SYSCONFDIR/sm-archive # conf file is here 24 cd SYSCONFDIR/sm-archive # conf file is here
25 SBINDIR/smarchive -d 10 -p local:/var/run/smarchive/smarchive.sock 25 SBINDIR/smarchive -d 10 -p local:/var/run/sm-archive/sm-archive.sock
26 RETVAL=$? 26 RETVAL=$?
27 pid=`pidof -s SBINDIR/smarchive` 27 pid=`pidof -s SBINDIR/smarchive`
28 if [ $pid ] 28 if [ $pid ]
29 then 29 then
30 success "Starting smarchive milter:" 30 success "Starting sm-archive milter:"
31 touch /var/lock/subsys/smarchive 31 touch /var/lock/subsys/smarchive
32 echo 32 echo
33 else 33 else
34 failure "Starting smarchive milter:" 34 failure "Starting sm-archive 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 "smarchive milter already running!" 39 failure "sm-archive 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 smarchive-milter: " 46 echo -n "Shutting down sm-archive-milter: "
47 killproc smarchive 47 killproc smarchive
48 RETVAL=$? 48 RETVAL=$?
49 echo 49 echo
50 [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/smarchive 50 [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/smarchive
51 ;; 51 ;;
57 status) 57 status)
58 status smarchive 58 status smarchive
59 RETVAL=$? 59 RETVAL=$?
60 ;; 60 ;;
61 *) 61 *)
62 echo "Usage: smarchive {start|stop|restart|status}" 62 echo "Usage: sm-archive {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$