]> git.pld-linux.org Git - packages/cyrus-sasl.git/blob - saslauthd.init
- remove trash
[packages/cyrus-sasl.git] / saslauthd.init
1 #!/bin/sh
2 #
3 # saslauthd     SASL AUTH Daemon
4 #
5 # chkconfig:    2345 40 60
6 # description:  SASL AUTH Daemon
7 # processname:  saslauthd
8 # pidfile:      /var/lib/sasl2/saslauthd.pid
9
10 # $Id$
11
12 # Source function library
13 . /etc/rc.d/init.d/functions
14
15 # Get service config
16 [ -f /etc/sysconfig/saslauthd ] && . /etc/sysconfig/saslauthd
17
18 if [ "x$SASL_AUTHMECH" != "x" ]; then
19         SASLAUTHD_OPTS="$SASLAUTHD_OPTS -a $SASL_AUTHMECH"
20 fi
21
22 if [ "x$SASL_RIMAP_HOSTNAME" != "x" ]; then
23         SASLAUTHD_OPTS="$SASLAUTHD_OPTS -O $SASL_RIMAP_HOSTNAME"
24 fi
25
26 start() {
27         if [ ! -f /var/lock/subsys/saslauthd ]; then
28                 msg_starting saslauthd
29                 daemon /usr/sbin/saslauthd $SASLAUTHD_OPTS
30                 RETVAL=$?
31                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/saslauthd
32         else
33                 msg_already_running saslauthd
34         fi
35 }
36
37 stop() {
38         if [ -f /var/lock/subsys/saslauthd ]; then
39                 msg_stopping saslauthd
40                 killproc saslauthd
41                 rm -f /var/lock/subsys/saslauthd /var/lib/sasl2/saslauthd.pid >/dev/null 2>&1
42         else
43                 msg_not_running saslauthd
44         fi
45 }
46
47 condrestart() {
48         if [ -f /var/lock/subsys/saslauthd ]; then
49                 stop
50                 start
51         else
52                 msg_not_running saslauthd
53                 RETVAL=$1
54         fi
55 }
56
57 RETVAL=0
58 # See how we were called.
59 case "$1" in
60   start)
61         start
62         ;;
63   stop)
64         stop
65         ;;
66   restart)
67         stop
68         start
69         ;;
70   try-restart)
71         condrestart 0
72         ;;
73   force-reload)
74         condrestart 7
75         ;;
76   status)
77         status saslauthd
78         exit $?
79         ;;
80   *)
81         msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
82         exit 3
83 esac
84
85 exit $RETVAL
This page took 0.184771 seconds and 3 git commands to generate.