]> git.pld-linux.org Git - packages/cyrus-sasl.git/blob - saslauthd.init
- updated,
[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/state/sasl/mux.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 -H $SASL_RIMAP_HOSTNAME"
24 fi
25
26 #if is_yes "$SASL_TIME_OF_DAY_LOGIN_RESTRICTIONS" ; then
27 #       SASLAUTHD_OPTS="$SASLAUTHD_OPTS -T"
28 #fi
29
30 # See how we were called.
31 case "$1" in
32   start)
33         # Check if the service is already running?
34         if [ ! -f /var/lock/subsys/saslauthd ]; then
35                 msg_starting salsauthd
36                 daemon saslauthd $SASLAUTHD_OPTS
37                 RETVAL=$?
38                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/saslauthd
39         else
40                 msg_already_running saslauthd
41                 exit 1
42         fi
43         ;;
44   stop)
45         # Stop daemons.
46         if [ -f /var/lock/subsys/saslauthd ]; then
47                 msg_stopping saslauthd
48                 killproc saslauthd
49                 rm -f /var/lock/subsys/saslauthd /var/run/saslauthd.pid >/dev/null 2>&1
50         else
51                 msg_not_running saslauthd
52                 exit 1
53         fi
54         ;;
55   status)
56         status saslauthd
57         exit $?
58         ;;
59   restart|reload)
60         $0 stop
61         $0 start
62         ;;
63   *)
64         msg_usage "$0 {start|stop|restart|status}"
65         exit 1
66         ;;
67 esac
68
69 exit $RETVAL
This page took 0.144211 seconds and 4 git commands to generate.