From 89af4c3c5aecdf49e0c406ee7f6b6604b1d2c717 Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Sat, 15 Dec 2007 19:26:10 +0000 Subject: [PATCH] - fixed force-reload, added try-restart action Changed files: dhcp6c.init -> 1.6 dhcp6s.init -> 1.7 --- dhcp6c.init | 20 ++++++++++++++++++-- dhcp6s.init | 20 ++++++++++++++++++-- 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/dhcp6c.init b/dhcp6c.init index 5610df1..a90d641 100644 --- a/dhcp6c.init +++ b/dhcp6c.init @@ -52,6 +52,16 @@ stop() { 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 @@ case "$1" in 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 diff --git a/dhcp6s.init b/dhcp6s.init index 8ccea44..9adb5d1 100644 --- a/dhcp6s.init +++ b/dhcp6s.init @@ -53,6 +53,16 @@ stop() { 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 @@ case "$1" in 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 -- 2.44.0