Hi,

> FYI, the "ocf" drbd agent does loop on monitor,
> and should return a generic error in that case already.

That's good!

> Maybe we should add such a loop to drbddisk as well.
> Or somehow set it up as a wrapper around the ocf agent (though that may
> not be easily possible).
>
> Yes, your patch is ok.
> Still I'm not taking it as such, but probably make drbdsetup more robust
> in face of file system problems on /var/lock/, and add a monitoring loop
> to drbddisk instead.

make sense.
I modified my patch.
It imitates drbd_stop() in ocf drbd.

Thanks,
Junko
--- drbddisk.org	2010-06-15 17:48:30.000000000 +0900
+++ drbddisk.tmp	2010-07-12 18:44:43.000000000 +0900
@@ -44,28 +44,21 @@ case "$CMD" in
 	done
 	;;
     stop)
-	$DRBDADM secondary $RES
-	ex=$?
-	case $ex in
-	0)
-		exit 0
-		;;
-	11)
-		# see drbdadm_main.c adm_generic and m_system
-		# as well as drbdsetup.c:
-		# in fact a role change was attempted, but failed.
-		echo >&2 "$DRBDADM secondary $RES: exit code $ex, mapping to 1"
-		exit 1 # LSB generic error
-		;;
-	*)
-		# other error, may be syntax error in config file,
-		# anything else: to not confuse heartbeat further,
-		# and avoid reboot due so "failed stop recovery",
-		# pretend that we succeeded in stopping this.
-		echo >&2 "$DRBDADM secondary $RES: exit code $ex, mapping to 0"
-		exit 0
-		;;
-	esac
+	rc=1
+	while true; do
+		$DRBDADM secondary $RES
+		status=$?
+		case $status in
+		0)
+			rc=0
+			break
+			;;
+		*)
+			sleep 1
+			;;
+		esac
+	done
+	exit $rc
 	;;
     status)
 	if [ "$RES" = "all" ]; then
_______________________________________________
drbd-user mailing list
[email protected]
http://lists.linbit.com/mailman/listinfo/drbd-user

Reply via email to