]> git.pld-linux.org Git - packages/cyrus-sasl.git/blame - saslauthd.init
- remove trash
[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
7b3dc8ae 18if [ "x$SASL_AUTHMECH" != "x" ]; then
f1b54e59
AF
19 SASLAUTHD_OPTS="$SASLAUTHD_OPTS -a $SASL_AUTHMECH"
20fi
21
7b3dc8ae 22if [ "x$SASL_RIMAP_HOSTNAME" != "x" ]; then
fed81295 23 SASLAUTHD_OPTS="$SASLAUTHD_OPTS -O $SASL_RIMAP_HOSTNAME"
f1b54e59
AF
24fi
25
8065f390 26start() {
7436efc0 27 if [ ! -f /var/lock/subsys/saslauthd ]; then
894e1273 28 msg_starting saslauthd
df723991 29 daemon /usr/sbin/saslauthd $SASLAUTHD_OPTS
7436efc0 30 RETVAL=$?
31 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/saslauthd
f1b54e59 32 else
7436efc0 33 msg_already_running saslauthd
f1b54e59 34 fi
8065f390
JB
35}
36
37stop() {
f1b54e59 38 if [ -f /var/lock/subsys/saslauthd ]; then
7436efc0 39 msg_stopping saslauthd
40 killproc saslauthd
6ff4cba0 41 rm -f /var/lock/subsys/saslauthd /var/lib/sasl2/saslauthd.pid >/dev/null 2>&1
7436efc0 42 else
9e27eb77 43 msg_not_running saslauthd
f1b54e59 44 fi
8065f390
JB
45}
46
47condrestart() {
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
57RETVAL=0
58# See how we were called.
59case "$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
f1b54e59
AF
75 ;;
76 status)
77 status saslauthd
78 exit $?
79 ;;
f1b54e59 80 *)
8065f390 81 msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
7b3dc8ae 82 exit 3
f1b54e59
AF
83esac
84
85exit $RETVAL
This page took 0.046826 seconds and 4 git commands to generate.