commit 6a339a06545fdabe9ae5276fb3fdf3ec85a184bf
Author: Elan Ruusamäe <[email protected]>
Date:   Tue Sep 4 22:52:34 2012 +0300

    - unify

 nscd.init | 37 ++++++++++++++++++++-----------------
 1 file changed, 20 insertions(+), 17 deletions(-)
---
diff --git a/nscd.init b/nscd.init
index e61c0fd..d231074 100755
--- a/nscd.init
+++ b/nscd.init
@@ -21,36 +21,39 @@
 [ -f /etc/sysconfig/nscd ] && . /etc/sysconfig/nscd
 
 start() {
-       if [ ! -f /var/lock/subsys/nscd ]; then
-               msg_starting "Name Switch Cache Daemon"
-               daemon /usr/sbin/nscd
-               RETVAL=$?
-               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/nscd
-       else
+       if [ -f /var/lock/subsys/nscd ]; then
                msg_already_running "Name Switch Cache Daemon"
+               return
        fi
+
+       msg_starting "Name Switch Cache Daemon"
+       daemon /usr/sbin/nscd
+       RETVAL=$?
+       [ $RETVAL -eq 0 ] && touch /var/lock/subsys/nscd
 }
 
 stop() {
-       if [ -f /var/lock/subsys/nscd ]; then
-               msg_stopping "Name Switch Cache Daemon"
-               busy
-               /usr/sbin/nscd -K >/dev/null
-               rm -f /var/lock/subsys/nscd >/dev/null 2>&1
-               ok
-       else
+       if [ ! -f /var/lock/subsys/nscd ]; then
                msg_not_running "Name Switch Cache Daemon"
+               return
        fi
+
+       msg_stopping "Name Switch Cache Daemon"
+       busy
+       /usr/sbin/nscd -K >/dev/null
+       rm -f /var/lock/subsys/nscd >/dev/null 2>&1
+       ok
 }
 
 condrestart() {
-       if [ -f /var/lock/subsys/nscd ]; then
-               stop
-               start
-       else
+       if [ ! -f /var/lock/subsys/nscd ]; then
                msg_not_running "Name Switch Cache Daemon"
                RETVAL=$1
+               return
        fi
+
+       stop
+       start
 }
 
 # return true if service is considered "up"
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/unscd.git/commitdiff/6a339a06545fdabe9ae5276fb3fdf3ec85a184bf

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to