SOURCES: dhcp6c.init, dhcp6s.init - fixed force-reload, added try-...

qboosh qboosh at pld-linux.org
Sat Dec 15 20:26:15 CET 2007


Author: qboosh                       Date: Sat Dec 15 19:26:15 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- fixed force-reload, added try-restart action

---- Files affected:
SOURCES:
   dhcp6c.init (1.5 -> 1.6) , dhcp6s.init (1.6 -> 1.7) 

---- Diffs:

================================================================
Index: SOURCES/dhcp6c.init
diff -u SOURCES/dhcp6c.init:1.5 SOURCES/dhcp6c.init:1.6
--- SOURCES/dhcp6c.init:1.5	Sat Dec 15 19:31:00 2007
+++ SOURCES/dhcp6c.init	Sat Dec 15 20:26:10 2007
@@ -52,6 +52,16 @@
 	fi
 }
 
+condrestart() {
+	if [ -f /var/lock/subsys/dhcp6c ]; then
+		stop
+		start
+	else
+		msg_not_running "DHCPv6 client daemon"
+		RETVAL=$1
+	fi
+}
+
 RETVAL=0
 case "$1" in
   start)
@@ -60,16 +70,22 @@
   stop)
   	stop
 	;;
-  restart|reload)
+  restart)
 	stop
 	start
 	;;
+  try-restart)
+	condrestart 0
+	;;
+  force-reload)
+	condrestart 7
+	;;
   status)
 	status dhcp6c
 	exit $?
 	;;
   *)
-	msg_usage "$0 {start|stop|restart|force-reload|status}"
+	msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
 	exit 3
 esac
 

================================================================
Index: SOURCES/dhcp6s.init
diff -u SOURCES/dhcp6s.init:1.6 SOURCES/dhcp6s.init:1.7
--- SOURCES/dhcp6s.init:1.6	Sat Dec 15 19:31:00 2007
+++ SOURCES/dhcp6s.init	Sat Dec 15 20:26:10 2007
@@ -53,6 +53,16 @@
 	fi
 }
 
+condrestart() {
+	if [ -f /var/lock/subsys/dhcp6s ]; then
+		stop
+		start
+	else
+		msg_not_running "DHCPv6 server daemon"
+		RETVAL=$1
+	fi
+}
+
 RETVAL=0
 case "$1" in
   start)
@@ -61,16 +71,22 @@
   stop)
   	stop
 	;;
-  restart|reload)
+  restart)
 	stop
 	start
 	;;
+  try-restart)
+	condrestart 0
+	;;
+  force-reload)
+	condrestart 7
+	;;
   status)
 	status dhcp6s
 	exit $?
 	;;
   *)
-	msg_usage "$0 {start|stop|restart|force-reload|status}"
+	msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
 	exit 3
 esac
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/dhcp6c.init?r1=1.5&r2=1.6&f=u
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/dhcp6s.init?r1=1.6&r2=1.7&f=u



More information about the pld-cvs-commit mailing list