]> git.pld-linux.org Git - packages/cyrus-sasl.git/blame - saslauthd.init
- new gcc doesn't like more things
[packages/cyrus-sasl.git] / saslauthd.init
CommitLineData
f1b54e59
AF
1#!/bin/sh
2#
3# saslauthd SASL AUTH Daemon
4#
5# chkconfig: 2345 40 60
6# description: SASL AUTH Daemon
7# processname: saslauthd
6ff4cba0 8# pidfile: /var/lib/sasl2/saslauthd.pid
f1b54e59
AF
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
3e341089 18if [ "$SASL_AUTHMECH" ]; then
f1b54e59
AF
19 SASLAUTHD_OPTS="$SASLAUTHD_OPTS -a $SASL_AUTHMECH"
20fi
21
3e341089 22if [ "$SASL_RIMAP_HOSTNAME" ]; then
fed81295 23 SASLAUTHD_OPTS="$SASLAUTHD_OPTS -O $SASL_RIMAP_HOSTNAME"
f1b54e59
AF
24fi
25
3e341089
ER
26if is_yes "$SASLAUTHD_CACHE"; then
27 SASLAUTHD_OPTS="$SASLAUTHD_OPTS -c"
28fi
29
30if [ "$SASLAUTHD_THREADS" ]; then
31 SASLAUTHD_OPTS="$SASLAUTHD_OPTS -n $SASLAUTHD_THREADS"
32fi
33
8065f390 34start() {
7436efc0 35 if [ ! -f /var/lock/subsys/saslauthd ]; then
894e1273 36 msg_starting saslauthd
df723991 37 daemon /usr/sbin/saslauthd $SASLAUTHD_OPTS
7436efc0 38 RETVAL=$?
39 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/saslauthd
f1b54e59 40 else
7436efc0 41 msg_already_running saslauthd
f1b54e59 42 fi
8065f390
JB
43}
44
45stop() {
f1b54e59 46 if [ -f /var/lock/subsys/saslauthd ]; then
7436efc0 47 msg_stopping saslauthd
48 killproc saslauthd
6ff4cba0 49 rm -f /var/lock/subsys/saslauthd /var/lib/sasl2/saslauthd.pid >/dev/null 2>&1
7436efc0 50 else
9e27eb77 51 msg_not_running saslauthd
f1b54e59 52 fi
8065f390
JB
53}
54
55condrestart() {
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
65RETVAL=0
66# See how we were called.
67case "$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
f1b54e59
AF
83 ;;
84 status)
85 status saslauthd
86 exit $?
87 ;;
f1b54e59 88 *)
8065f390 89 msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
7b3dc8ae 90 exit 3
f1b54e59
AF
91esac
92
93exit $RETVAL
This page took 0.04916 seconds and 4 git commands to generate.