On Mon, Jun 29, 2015 at 12:50:50PM +0200, Lars Ellenberg wrote:
> On Mon, Jun 29, 2015 at 12:40:33PM +0200, Lars Ellenberg wrote:
> > On Mon, Jun 29, 2015 at 05:14:10PM +0900, Hiroshi Fujishima wrote:
> > > > I notice the following error message.
> > > > 
> > > > Jun 26 13:41:01 sac-tkh-sv001 pacemaker_remoted[32149]: notice: 
> > > > operation_finished: res_drbd_r0_monitor_10000:25537:stderr [ This 
> > > > command will ignore resource names! ]
> > > > 
> > > > This messages is generated by drbd_set_status_variables().
> > > > 
> > > > http://git.drbd.org/gitweb.cgi?p=drbd-utils.git;a=blob;f=scripts/drbd.ocf;h=0481a32a97a3b5fb814871e46d48024ea112abf4;hb=HEAD#l311
> > > > 
> > > > [root@sac-tkh-sv001 ~]# drbdadm -c /etc/drbd.conf sh-status r0 > 
> > > > /devnull
> > > > This command will ignore resource names!
> > > > 
> > > > I think "$DRBD_RESOURCE" argument is not required.
> > 
> > Oh yes, it is.
> > But the "fix", changing drbdsetup to drbdadm for "compatibility",
> > actually broke more than it fixed :-(
> > 
> > please change:

Regression fix committed:
http://git.linbit.com/gitweb.cgi?p=drbd-utils.git;a=commitdiff;h=b766142c3e372736d5233d2b4dad3ea190f5d047

        Lars
>From b766142c3e372736d5233d2b4dad3ea190f5d047 Mon Sep 17 00:00:00 2001
From: Lars Ellenberg <[email protected]>
Date: Mon, 29 Jun 2015 15:30:36 +0200
Subject: [PATCH] drbd.ocf: fix regression introduced by "fix compat mode ...
 drbd 8.3 kernel"

Regression introduced with
  drbd.ocf: fix compat mode when using 8.9.2 utils with drbd 8.3 kernel

I switched to use drbdadm instead of drbdsetup,
because that would use the correct commandline parameters.

It does, but it also ignores the resource name parameter,
and reports status about *all* configured DRBD resources/devices.

Which may seriously confuse this resource agent,
as soon as you have more than one resource.

Fix:
  still use drbdsetup to get the resource specific status,
  but use resource-name for 8.4, and device-name for 8.3.
---
 scripts/drbd.ocf | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/scripts/drbd.ocf b/scripts/drbd.ocf
index 0481a32..0733a8d 100644
--- a/scripts/drbd.ocf
+++ b/scripts/drbd.ocf
@@ -308,7 +308,13 @@ drbd_set_status_variables() {
 	DRBD_DSTATE_LOCAL=()
 	DRBD_DSTATE_REMOTE=()
 
-	eval "$($DRBDADM sh-status "$DRBD_RESOURCE")"
+	if $DRBD_HAS_MULTI_VOLUME ; then
+		eval "$($DRBDSETUP sh-status "$DRBD_RESOURCE")"
+	else
+		# without "MULTI_VOLUME", the DRBD_DEVICES array
+		# should contain exactly one value
+		eval "$($DRBDSETUP "$DRBD_DEVICES" sh-status)"
+	fi
 
 	# if there was no output at all, or a weird output
 	# make sure the status arrays won't be empty.
-- 
1.9.1

_______________________________________________
drbd-user mailing list
[email protected]
http://lists.linbit.com/mailman/listinfo/drbd-user

Reply via email to