]> git.pld-linux.org Git - packages/cyrus-sasl.git/commitdiff
- sync with template.init
authorElan Ruusamäe <glen@pld-linux.org>
Mon, 5 Apr 2010 19:16:07 +0000 (19:16 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    saslauthd.init -> 1.12

saslauthd.init

index 41ee545b3216c8e44ecaa03735e7ceee5b15f3c4..fd7df0cb2e7254674120c46e7472e9b58ff527ac 100644 (file)
@@ -1,18 +1,33 @@
 #!/bin/sh
 #
-# saslauthd    SASL AUTH Daemon
+# saslauthd    saslauthd short service description
 #
 # chkconfig:   2345 40 60
+#
 # description: SASL AUTH Daemon
+#
 # processname: saslauthd
 # pidfile:     /var/lib/sasl2/saslauthd.pid
-
+#
 # $Id$
 
 # Source function library
 . /etc/rc.d/init.d/functions
 
-# Get service config
+# Get network config
+. /etc/sysconfig/network
+
+# Check that networking is up.
+if is_yes "${NETWORKING}"; then
+       if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
+               msg_network_down "SASL AUTH Daemon"
+               exit 1
+       fi
+else
+       exit 0
+fi
+
+# Get service config - may override defaults
 [ -f /etc/sysconfig/saslauthd ] && . /etc/sysconfig/saslauthd
 
 if [ "$SASL_AUTHMECH" ]; then
@@ -32,44 +47,49 @@ if [ "$SASLAUTHD_THREADS" ]; then
 fi
 
 start() {
-       if [ ! -f /var/lock/subsys/saslauthd ]; then
-               msg_starting saslauthd
-               daemon /usr/sbin/saslauthd $SASLAUTHD_OPTS
-               RETVAL=$?
-               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/saslauthd
-       else
-               msg_already_running saslauthd
+       # Check if the service is already running?
+       if [ -f /var/lock/subsys/saslauthd ]; then
+               msg_already_running "SASL AUTH Daemon"
+               return
        fi
+
+       msg_starting "SASL AUTH Daemon"
+       daemon /usr/sbin/saslauthd $SASLAUTHD_OPTS
+       RETVAL=$?
+       [ $RETVAL -eq 0 ] && touch /var/lock/subsys/saslauthd
 }
 
 stop() {
-       if [ -f /var/lock/subsys/saslauthd ]; then
-               msg_stopping saslauthd
-               killproc saslauthd
-               rm -f /var/lock/subsys/saslauthd /var/lib/sasl2/saslauthd.pid >/dev/null 2>&1
-       else
-               msg_not_running saslauthd
+       if [ ! -f /var/lock/subsys/saslauthd ]; then
+               msg_not_running "SASL AUTH Daemon"
+               return
        fi
+
+       # Stop daemons.
+       msg_stopping "SASL AUTH Daemon"
+       killproc saslauthd
+       rm -f /var/lock/subsys/saslauthd /var/lib/sasl2/saslauthd.pid >/dev/null 2>&1
 }
 
 condrestart() {
-       if [ -f /var/lock/subsys/saslauthd ]; then
-               stop
-               start
-       else
-               msg_not_running saslauthd
+       if [ ! -f /var/lock/subsys/saslauthd ]; then
+               msg_not_running "SASL AUTH Daemon"
                RETVAL=$1
+               return
        fi
+
+       stop
+       start
 }
 
 RETVAL=0
 # See how we were called.
 case "$1" in
   start)
-       start
+       start
        ;;
   stop)
-       stop
+       stop
        ;;
   restart)
        stop
@@ -83,7 +103,7 @@ case "$1" in
        ;;
   status)
        status saslauthd
-       exit $?
+       RETVAL=$?
        ;;
   *)
        msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
This page took 0.101057 seconds and 4 git commands to generate.