annotate sm-archive.rc @ 15:72a94c46c2be stable-1-5

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