Skip to contentSkip to conversation

radvd: eliminate confusing warnings when stop service

PATCH Applied Liang Li 2 participants 2 messages Mar 12, 2014 – Mar 14, 2014

lore
Share & tools
lore

Liang Li

author
#0 lore raw

PATCH 1/1 radvd: eliminate confusing warnings when stop service

When run 'service radvd stop' in case radvd is not started/running, we'll get warnings like this:

Stopping radvd: no /usr/sbin/radvd found; none killed /etc/init.d/radvd: warning: cannot restore settings radvd.

We could by pass these OPs by just check if the service is running or not so eliminate possible warnings.

---
 recipes-daemons/radvd/files/radvd.init | 4 ++++

1 个文件被修改,插入 4 行(+)

recipes-daemons/radvd/files/radvd.init +4 -0
index 921384c..5295292 100755
@@ -92,6 +92,10 @@ case "$1" in
 	;;
   stop)
 	echo -n "Stopping $DESC: "
+	if ! [ -f $PIDFILE ] ; then
+		echo "not running."
+		exit 0
+	fi
 	start-stop-daemon --oknodo --stop --pidfile $PIDFILE \
 		--exec $DAEMON
 	restore_settings $SAVED_SETTINGS
Signature · 1 line
1.7.11.4
#1 lore raw

Merged, thanks.
-J.

Quoted 31 lines · [[meta-networking] radvd: eliminate confusing warnings when stop service] On…

When run 'service radvd stop' in case radvd is not started/running, we'll get warnings like this:

Stopping radvd: no /usr/sbin/radvd found; none killed /etc/init.d/radvd: warning: cannot restore settings radvd.

We could by pass these OPs by just check if the service is running or not so eliminate possible warnings.

---
recipes-daemons/radvd/files/radvd.init | 4 ++++
1 ????????? 4 ?(+)

meta-networking/recipes-daemons/radvd/files/radvd.init +4 -0
index 921384c..5295292 100755
@@ -92,6 +92,10 @@ case "$1" in
 	;;
   stop)
 	echo -n "Stopping $DESC: "
+	if ! [ -f $PIDFILE ] ; then
+		echo "not running."
+		exit 0
+	fi
 	start-stop-daemon --oknodo --stop --pidfile $PIDFILE \
 		--exec $DAEMON
 	restore_settings $SAVED_SETTINGS
Signature · 2 lines
-Joe MacDonald.
:wq