]> git.pld-linux.org Git - packages/cyrus-sasl.git/blob - saslauthd.init
- new gcc doesn't like more things
[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 [ "$SASL_AUTHMECH" ]; then
19         SASLAUTHD_OPTS="$SASLAUTHD_OPTS -a $SASL_AUTHMECH"
20 fi
21
22 if [ "$SASL_RIMAP_HOSTNAME" ]; then
23         SASLAUTHD_OPTS="$SASLAUTHD_OPTS -O $SASL_RIMAP_HOSTNAME"
24 fi
25
26 if is_yes "$SASLAUTHD_CACHE"; then
27         SASLAUTHD_OPTS="$SASLAUTHD_OPTS -c"
28 fi
29
30 if [ "$SASLAUTHD_THREADS" ]; then
31         SASLAUTHD_OPTS="$SASLAUTHD_OPTS -n $SASLAUTHD_THREADS"
32 fi
33
34 start() {
35         if [ ! -f /var/lock/subsys/saslauthd ]; then
36                 msg_starting saslauthd
37                 daemon /usr/sbin/saslauthd $SASLAUTHD_OPTS
38                 RETVAL=$?
39                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/saslauthd
40         else
41                 msg_already_running saslauthd
42         fi
43 }
44
45 stop() {
46         if [ -f /var/lock/subsys/saslauthd ]; then
47                 msg_stopping saslauthd
48                 killproc saslauthd
49                 rm -f /var/lock/subsys/saslauthd /var/lib/sasl2/saslauthd.pid >/dev/null 2>&1
50         else
51                 msg_not_running saslauthd
52         fi
53 }
54
55 condrestart() {
56         if [ -f /var/lock/subsys/saslauthd ]; then
57                 stop
58                 start
59         else
60                 msg_not_running saslauthd
61                 RETVAL=$1
62         fi
63 }
64
65 RETVAL=0
66 # See how we were called.
67 case "$1" in
68   start)
69         start
70         ;;
71   stop)
72         stop
73         ;;
74   restart)
75         stop
76         start
77         ;;
78   try-restart)
79         condrestart 0
80         ;;
81   force-reload)
82         condrestart 7
83         ;;
84   status)
85         status saslauthd
86         exit $?
87         ;;
88   *)
89         msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
90         exit 3
91 esac
92
93 exit $RETVAL
This page took 0.07871 seconds and 3 git commands to generate.