[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[lvm-devel] [PATCH] Fix last 2 issues in clvmd init script to be LSB complaint



Hi all,

patch is pretty simple and straight forward.

With this patch we pass the 27 tests at 100%.

See https://bugzilla.redhat.com/show_bug.cgi?id=553381 for reference.

Thanks
Fabio
diff --git a/scripts/clvmd_init_red_hat.in b/scripts/clvmd_init_red_hat.in
index da09a34..cfa8ede 100644
--- a/scripts/clvmd_init_red_hat.in
+++ b/scripts/clvmd_init_red_hat.in
@@ -68,6 +68,7 @@ start()
 		echo -n "Starting $DAEMON: "
 		daemon $DAEMON $CLVMDOPTS || return $?
 		echo
+		pidof $DAEMON > /var/run/$DAEMON.pid
 	fi
 
 	# Refresh local cache.
@@ -135,6 +136,7 @@ stop()
 		echo
 	fi
 
+	rm -f /var/run/$DAEMON.pid
 	rm -f $LOCK_FILE
 
 	return 0
@@ -165,6 +167,11 @@ restart() {
 	fi
 }
 
+if [ "$EUID" != "0" ]; then
+	echo "Only root can execute $0 script"
+	exit 4
+fi
+
 # See how we were called.
 case "$1" in
   start)

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]