All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix some issues in clvmd initscript
@ 2010-05-26 13:01 Milan Broz
  2010-06-03  7:05 ` Fabio M. Di Nitto
  0 siblings, 1 reply; 11+ messages in thread
From: Milan Broz @ 2010-05-26 13:01 UTC (permalink / raw)
  To: lvm-devel

- if daemon is already running, do nothing (and not reactivate VGs)

- always explicitly return exit code in reload()

- fix restart() so it really tries full start & stop and returns exit code
  if clvmd -S fails and also touch lockfile afterwards

--- clvmd.old	2010-05-26 14:21:15.000000000 +0200
+++ clvmd	2010-05-26 14:55:17.671245376 +0200
@@ -63,11 +63,12 @@ rh_status_q() {
 
 start()
 {
-	if ! rh_status_q; then
-		echo -n "Starting $DAEMON: "
-		daemon $DAEMON $CLVMDOPTS || return $?
-		echo
-	fi
+
+	rh_status_q && return 0
+
+	echo -n "Starting $DAEMON: "
+	daemon $DAEMON $CLVMDOPTS || return $?
+	echo
 
 	# Refresh local cache.
 	#
@@ -141,7 +142,8 @@ stop()
 
 reload() {
 	rh_status_q || exit 7
-	action "Reloading $DAEMON configuration: " $DAEMON -R || return $?
+	action "Reloading $DAEMON configuration: " $DAEMON -R
+	return $?
 }
 
 restart() {
@@ -152,13 +154,15 @@ restart() {
 
 	# Try to get clvmd to restart itself. This will preserve 
 	# exclusive LV locks
-	action "Restarting $DAEMON: " $DAEMON -S || return $?
+	action "Restarting $DAEMON: " $DAEMON -S
 
 	# If that fails then do a normal stop & restart
 	if  [ $? != 0 ]; then
 	    stop && start
+	    return $?
 	else
 	    touch $LOCK_FILE
+	    return 0
 	fi
 }
 




^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-06-03 20:57 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-26 13:01 [PATCH] fix some issues in clvmd initscript Milan Broz
2010-06-03  7:05 ` Fabio M. Di Nitto
2010-06-03  9:51   ` Milan Broz
2010-06-03 11:43     ` Fabio M. Di Nitto
2010-06-03 18:31       ` brem belguebli
2010-06-03 19:51         ` Alasdair G Kergon
2010-06-03 20:15           ` Brem Belguebli
2010-06-03 20:20             ` Alasdair G Kergon
2010-06-03 20:25               ` Brem Belguebli
2010-06-03 20:34                 ` Alasdair G Kergon
2010-06-03 20:57                   ` Brem Belguebli

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.