annotate sm-archive.rc @ 1:45c8592d5d13

initial version
author carl
date Fri, 10 Mar 2006 10:35:25 -0800
parents
children b8a3b366635a
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 #
45c8592d5d13 initial version
carl
parents:
diff changeset
3 # sm-archive This script controls the sm-archive milter daemon.
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
45c8592d5d13 initial version
carl
parents:
diff changeset
7 # description: sm-archive allows adding recipients to mail passing thru this milter
45c8592d5d13 initial version
carl
parents:
diff changeset
8 # processname: sm-archive
45c8592d5d13 initial version
carl
parents:
diff changeset
9 # pidfile: /var/run/sm-archive.pid
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.
45c8592d5d13 initial version
carl
parents:
diff changeset
22 echo -n "Starting sm-archive-milter: "
45c8592d5d13 initial version
carl
parents:
diff changeset
23 if [ ! -f /var/lock/subsys/sm-archive ]; then
45c8592d5d13 initial version
carl
parents:
diff changeset
24 cd SYSCONFDIR # conf file is here
45c8592d5d13 initial version
carl
parents:
diff changeset
25 SBINDIR/sm-archive -d 10 -p local:/var/run/sm-archive/sm-archive.sock
45c8592d5d13 initial version
carl
parents:
diff changeset
26 RETVAL=$?
45c8592d5d13 initial version
carl
parents:
diff changeset
27 pid=`pidof -s SBINDIR/sm-archive`
45c8592d5d13 initial version
carl
parents:
diff changeset
28 if [ $pid ]
45c8592d5d13 initial version
carl
parents:
diff changeset
29 then
45c8592d5d13 initial version
carl
parents:
diff changeset
30 success "Starting sm-archive milter:"
45c8592d5d13 initial version
carl
parents:
diff changeset
31 touch /var/lock/subsys/sm-archive
45c8592d5d13 initial version
carl
parents:
diff changeset
32 echo
45c8592d5d13 initial version
carl
parents:
diff changeset
33 else
45c8592d5d13 initial version
carl
parents:
diff changeset
34 failure "Starting sm-archive milter:"
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! "
45c8592d5d13 initial version
carl
parents:
diff changeset
39 failure "sm-archive milter already running!"
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.
45c8592d5d13 initial version
carl
parents:
diff changeset
46 echo -n "Shutting down sm-archive-milter: "
45c8592d5d13 initial version
carl
parents:
diff changeset
47 killproc sm-archive
45c8592d5d13 initial version
carl
parents:
diff changeset
48 RETVAL=$?
45c8592d5d13 initial version
carl
parents:
diff changeset
49 echo
45c8592d5d13 initial version
carl
parents:
diff changeset
50 [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sm-archive
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)
45c8592d5d13 initial version
carl
parents:
diff changeset
58 status sm-archive
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 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
62 echo "Usage: sm-archive {start|stop|restart|status}"
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$