]> git.pld-linux.org Git - packages/sssd.git/commitdiff
- unify
authorElan Ruusamäe <glen@pld-linux.org>
Fri, 21 Oct 2011 07:32:30 +0000 (07:32 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    sssd.init -> 1.2

sssd.init

index 2ec439b7742198f69f535574e92ecf0a3793c8ff..745283fa77e51ce9cd7972ff06e20721c0ac8942 100644 (file)
--- a/sssd.init
+++ b/sssd.init
@@ -33,54 +33,57 @@ fi
 
 start() {
        # Check if the service is already running?
-       if [ ! -f /var/lock/subsys/sssd ]; then
-               msg_starting "System Security Services Daemon"
-               daemon --fork /usr/sbin/sssd --defaults-file=/etc/sssd/sssd.conf
-               RETVAL=$?
-               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/sssd
-       else
+       if [ -f /var/lock/subsys/sssd ]; then
                msg_already_running "System Security Services Daemon"
+               return
        fi
+
+       msg_starting "System Security Services Daemon"
+       daemon --fork /usr/sbin/sssd --defaults-file=/etc/sssd/sssd.conf
+       RETVAL=$?
+       [ $RETVAL -eq 0 ] && touch /var/lock/subsys/sssd
 }
 
 stop() {
-       if [ -f /var/lock/subsys/sssd ]; then
-               # Stop daemons.
-               msg_stopping "System Security Services Daemon"
-               /sbin/start-stop-daemon -q --stop \
-                       --retry TERM/600/KILL/10 \
-                       -s TERM --pidfile /var/lib/sssd/sssd.pid
-               local result=$?
-               if [ "$result" -eq 0 ]; then
-                       ok
-               else
-                       fail
-               fi
+       if [ ! -f /var/lock/subsys/sssd ]; then
+               msg_not_running "System Security Services Daemon"
+               return
+       fi
 
-               rm -f /var/lock/subsys/sssd
+       # Stop daemons.
+       msg_stopping "System Security Services Daemon"
+       /sbin/start-stop-daemon -q --stop \
+               --retry TERM/600/KILL/10 \
+               -s TERM --pidfile /var/lib/sssd/sssd.pid
+       local result=$?
+       if [ "$result" -eq 0 ]; then
+               ok
        else
-               msg_not_running "System Security Services Daemon"
+               fail
        fi
+
+       rm -f /var/lock/subsys/sssd
 }
 
 condrestart() {
-       if [ -f /var/lock/subsys/sssd ]; then
-               stop
-               start
-       else
+       if [ ! -f /var/lock/subsys/sssd ]; then
                msg_not_running "System Security Services 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
This page took 0.091058 seconds and 4 git commands to generate.