comparison sm-archive.rc @ 1:45c8592d5d13

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