Subversion Repositories configs

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 - 1
#! /bin/bash
2
#
3
# saslauthd      Start/Stop the SASL authentication daemon
4
#
5
# chkconfig: - 65 10
6
# description: Saslauthd is a server process which handles plaintext \
7
#              authentication requests on behalf of the cyrus-sasl library.
8
# processname: saslauthd
9
 
10
### BEGIN INIT INFO
11
# Provides: saslauthd
12
# Required-Start: $local_fs $network
13
# Required-Stop: $local_fs $network
14
# Short-Description: Start/Stop the SASL authentication daemon
15
# Description: Saslauthd is a server process which handles plaintext
16
#              authentication requests on behalf of the cyrus-sasl library.
17
### END INIT INFO
18
 
19
# Source function library.
20
. /etc/init.d/functions
21
 
22
# Source our configuration file for these variables.
23
SOCKETDIR=/var/run/saslauthd
24
MECH=shadow
25
FLAGS=
26
if [ -f /etc/sysconfig/saslauthd ] ; then
27
	. /etc/sysconfig/saslauthd
28
fi
29
 
30
RETVAL=0
31
 
32
# Set up some common variables before we launch into what might be
33
# considered boilerplate by now.
34
prog=saslauthd
35
path=/usr/sbin/saslauthd
36
lockfile=/var/lock/subsys/$prog
37
pidfile=/var/run/saslauthd/saslauthd.pid
38
 
39
start() {
40
	[ -x $path ] || exit 5
41
	echo -n $"Starting $prog: "
42
	daemon $DAEMONOPTS $path -m $SOCKETDIR -a $MECH $FLAGS
43
	RETVAL=$?
44
	echo
45
	[ $RETVAL -eq 0 ] && touch $lockfile
46
	return $RETVAL
47
}
48
 
49
stop() {
50
	echo -n $"Stopping $prog: "
51
	killproc $prog
52
	RETVAL=$?
53
	echo
54
	[ $RETVAL -eq 0 ] && rm -f $lockfile
55
	return $RETVAL
56
}
57
 
58
restart() {
59
  	stop
60
	start
61
}
62
 
63
reload() {
64
	restart
65
}
66
 
67
force_reload() {
68
	restart
69
}
70
 
71
rh_status() {
72
	# run checks to determine if the service is running or use generic status
73
	status -p $pidfile $prog
74
}
75
 
76
rh_status_q() {
77
	rh_status >/dev/null 2>&1
78
}
79
 
80
case "$1" in
81
  start)
82
	rh_status_q && exit 0
83
  	start
84
	;;
85
  stop)
86
	rh_status_q || exit 0
87
  	stop
88
	;;
89
  restart)
90
  	restart
91
	;;
92
  reload)
93
	rh_status_q || exit 7
94
	reload
95
	;;
96
  force-reload)
97
	force_reload
98
	;;
99
  status)
100
	rh_status
101
	;;
102
  condrestart|try-restart)
103
	rh_status_q || exit 0
104
	restart
105
	;;
106
  *)
107
	echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
108
	exit 2
109
esac
110
 
111
exit $?