2004-09-09 04:03:40 +00:00
|
|
|
#! /bin/bash
|
|
|
|
#
|
2009-01-23 16:05:35 +00:00
|
|
|
# saslauthd Start/Stop the SASL authentication daemon
|
2004-09-09 04:03:40 +00:00
|
|
|
#
|
2009-01-23 16:05:35 +00:00
|
|
|
# chkconfig: - 65 10
|
|
|
|
# description: Saslauthd is a server process which handles plaintext \
|
2004-09-09 04:03:40 +00:00
|
|
|
# authentication requests on behalf of the cyrus-sasl library.
|
|
|
|
# processname: saslauthd
|
|
|
|
|
2009-01-23 16:05:35 +00:00
|
|
|
### BEGIN INIT INFO
|
|
|
|
# Provides: saslauthd
|
|
|
|
# Required-Start: $local_fs $network
|
|
|
|
# Required-Stop: $local_fs $network
|
|
|
|
# Short-Description: Start/Stop the SASL authentication daemon
|
|
|
|
# Description: Saslauthd is a server process which handles plaintext
|
|
|
|
# authentication requests on behalf of the cyrus-sasl library.
|
|
|
|
### END INIT INFO
|
|
|
|
|
2004-09-09 04:03:40 +00:00
|
|
|
# Source function library.
|
|
|
|
. /etc/init.d/functions
|
|
|
|
|
|
|
|
# Source our configuration file for these variables.
|
2004-09-09 04:05:05 +00:00
|
|
|
SOCKETDIR=/var/run/saslauthd
|
2004-09-09 04:03:40 +00:00
|
|
|
MECH=shadow
|
|
|
|
FLAGS=
|
|
|
|
if [ -f /etc/sysconfig/saslauthd ] ; then
|
|
|
|
. /etc/sysconfig/saslauthd
|
|
|
|
fi
|
|
|
|
|
|
|
|
RETVAL=0
|
|
|
|
|
|
|
|
# Set up some common variables before we launch into what might be
|
|
|
|
# considered boilerplate by now.
|
|
|
|
prog=saslauthd
|
|
|
|
path=/usr/sbin/saslauthd
|
2009-01-23 16:05:35 +00:00
|
|
|
lockfile=/var/lock/subsys/$prog
|
2010-04-09 13:40:22 +00:00
|
|
|
pidfile=/var/run/saslauthd/saslauthd.pid
|
2004-09-09 04:06:54 +00:00
|
|
|
|
2004-09-09 04:03:40 +00:00
|
|
|
start() {
|
2009-01-23 16:05:35 +00:00
|
|
|
[ -x $path ] || exit 5
|
2004-09-09 04:03:40 +00:00
|
|
|
echo -n $"Starting $prog: "
|
2009-09-24 14:11:48 +00:00
|
|
|
daemon $DAEMONOPTS $path -m $SOCKETDIR -a $MECH $FLAGS
|
2004-09-09 04:03:40 +00:00
|
|
|
RETVAL=$?
|
|
|
|
echo
|
2009-01-23 16:05:35 +00:00
|
|
|
[ $RETVAL -eq 0 ] && touch $lockfile
|
2004-09-09 04:03:40 +00:00
|
|
|
return $RETVAL
|
|
|
|
}
|
|
|
|
|
|
|
|
stop() {
|
|
|
|
echo -n $"Stopping $prog: "
|
2009-01-23 16:05:35 +00:00
|
|
|
killproc $prog
|
2004-09-09 04:03:40 +00:00
|
|
|
RETVAL=$?
|
|
|
|
echo
|
2009-01-23 16:05:35 +00:00
|
|
|
[ $RETVAL -eq 0 ] && rm -f $lockfile
|
2004-09-09 04:03:40 +00:00
|
|
|
return $RETVAL
|
|
|
|
}
|
|
|
|
|
|
|
|
restart() {
|
|
|
|
stop
|
|
|
|
start
|
|
|
|
}
|
|
|
|
|
2009-01-23 16:05:35 +00:00
|
|
|
reload() {
|
|
|
|
restart
|
|
|
|
}
|
|
|
|
|
|
|
|
force_reload() {
|
|
|
|
restart
|
|
|
|
}
|
|
|
|
|
|
|
|
rh_status() {
|
|
|
|
# run checks to determine if the service is running or use generic status
|
2010-04-09 13:40:22 +00:00
|
|
|
status -p $pidfile $prog
|
2009-01-23 16:05:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
rh_status_q() {
|
|
|
|
rh_status >/dev/null 2>&1
|
|
|
|
}
|
|
|
|
|
2004-09-09 04:03:40 +00:00
|
|
|
case "$1" in
|
|
|
|
start)
|
2009-01-23 16:05:35 +00:00
|
|
|
rh_status_q && exit 0
|
2004-09-09 04:03:40 +00:00
|
|
|
start
|
|
|
|
;;
|
|
|
|
stop)
|
2009-01-23 16:05:35 +00:00
|
|
|
rh_status_q || exit 0
|
2004-09-09 04:03:40 +00:00
|
|
|
stop
|
|
|
|
;;
|
|
|
|
restart)
|
|
|
|
restart
|
|
|
|
;;
|
2009-01-23 16:05:35 +00:00
|
|
|
reload)
|
|
|
|
rh_status_q || exit 7
|
|
|
|
reload
|
|
|
|
;;
|
|
|
|
force-reload)
|
|
|
|
force_reload
|
|
|
|
;;
|
2004-09-09 04:03:40 +00:00
|
|
|
status)
|
2009-01-23 16:05:35 +00:00
|
|
|
rh_status
|
2004-09-09 04:03:40 +00:00
|
|
|
;;
|
2009-09-24 14:11:48 +00:00
|
|
|
condrestart|try-restart)
|
2009-01-23 16:05:35 +00:00
|
|
|
rh_status_q || exit 0
|
|
|
|
restart
|
2004-09-09 04:03:40 +00:00
|
|
|
;;
|
|
|
|
*)
|
2009-01-23 16:05:35 +00:00
|
|
|
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
|
|
|
|
exit 2
|
2004-09-09 04:03:40 +00:00
|
|
|
esac
|
|
|
|
|
|
|
|
exit $?
|