Distributed Replicated Block Device (DRBD) development
 help / color / mirror / Atom feed
* [Drbd-dev] [DRBD-8.0 PATCH] Make heartbeat script conform to LSB spec
@ 2008-01-11 15:14 Graham, Simon
  2008-01-14  8:21 ` Lars Ellenberg
  0 siblings, 1 reply; 2+ messages in thread
From: Graham, Simon @ 2008-01-11 15:14 UTC (permalink / raw)
  To: drbd-dev


[-- Attachment #1.1: Type: text/plain, Size: 175 bytes --]

The drbddisk script has a few places where it returns exit codes that
don't conform to the LSB spec when it could - this patch corrects the
ones I've seen.

 

Simon


[-- Attachment #1.2: Type: text/html, Size: 3464 bytes --]

[-- Attachment #2: 0002-Make-heartbeat-script-conform-to-LSB-spec.patch --]
[-- Type: application/octet-stream, Size: 1059 bytes --]

From b56371785abc5f22698dcffe699e0434a88beab7 Mon Sep 17 00:00:00 2001
From: Simon Graham <sgraham@anna.sn.stratus.com>
Date: Fri, 21 Dec 2007 21:12:27 -0500
Subject: [PATCH] Make heartbeat script conform to LSB spec

---
 scripts/drbddisk |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/scripts/drbddisk b/scripts/drbddisk
index 7d001f5..53e02a0 100755
--- a/scripts/drbddisk
+++ b/scripts/drbddisk
@@ -29,13 +29,15 @@ case "$CMD" in
 	try=6
 	while true; do
 		$DRBDADM primary $RES && break
-		let "--try" || exit 20
+		let "--try" || exit 1
 		sleep 1
 	done
 	;;
     stop)
-	# exec, so the exit code of drbdadm propagates
-	exec $DRBDADM secondary $RES
+	$DRBDADM secondary $RES
+	if [ $? -eq 11 ]; then
+	    exit 1
+	fi
 	;;
     status)
 	if [ "$RES" = "all" ]; then
@@ -46,10 +48,8 @@ case "$CMD" in
 	STATE=${ST%/*}
 	if [ "$STATE" = "Primary" ]; then
 	    echo "running"
-	elif [ "$STATE" = "Secondary" ]; then
-	    echo "stopped"
 	else
-	    echo "$ST"
+	    echo "stopped"
 	fi
 	;;
     *)
-- 
1.5.4.rc1


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

end of thread, other threads:[~2008-01-14  8:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-11 15:14 [Drbd-dev] [DRBD-8.0 PATCH] Make heartbeat script conform to LSB spec Graham, Simon
2008-01-14  8:21 ` Lars Ellenberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox