[packages/unscd] - unify

glen glen at pld-linux.org
Tue Sep 4 21:52:36 CEST 2012


commit 6a339a06545fdabe9ae5276fb3fdf3ec85a184bf
Author: Elan Ruusamäe <glen at delfi.ee>
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



More information about the pld-cvs-commit mailing list