Skip to contentSkip to conversation

cman init: make sure we start after fence_sanlockd and warn users

PATCH New Fabio M. Di Nitto 3 participants 12 messages Oct 9, 2012 – Oct 10, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 cman init: make sure we start after fence_sanlockd and warn users

From: "Fabio M. Di Nitto" <[email protected]>

Resolves: rhbz#509056

---
 cman/init.d/cman.in |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)
cman/init.d/cman.in +11 -2
index a88f52f..849739b 100644
@@ -8,8 +8,8 @@
 #
 ### BEGIN INIT INFO
 # Provides:		cman
-# Required-Start:	$network $time
-# Required-Stop:	$network $time
+# Required-Start:	$network $time fence_sanlockd
+# Required-Stop:	$network $time fence_sanlockd
 # Default-Start:
 # Default-Stop:
 # Short-Description:	Starts and stops cman
@@ -740,6 +740,13 @@ stop_cmannotifyd()
 	stop_daemon cmannotifyd
 }
 
+fence_sanlock_check()
+{
+	service fence_sanlockd status > /dev/null 2>&1 &&
+		echo "   fence_sanlockd detected. Unfencing might take several minutes!"
+	return 0
+}
+
 unfence_self()
 {
 	# fence_node returns 0 on success, 1 on failure, 2 if unconfigured
@@ -881,6 +888,8 @@ start()
 
 	[ "$breakpoint" = "daemons" ] && exit 0
 
+	fence_sanlock_check
+
 	runwrap unfence_self \
 		none \
 		"Unfencing self"
Signature · 1 line
1.7.7.6
#1 lore raw

PATCH 2/2 checkquorum.wdmd: add integration script with wdmd

From: "Fabio M. Di Nitto" <[email protected]>

requires wdmd >= 2.6

Resolves: rhbz#509056

---
 cman/scripts/Makefile         |    2 +-
 cman/scripts/checkquorum.wdmd |  104 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 105 insertions(+), 1 deletions(-)
 create mode 100644 cman/scripts/checkquorum.wdmd
cman/scripts/Makefile +1 -1
index b4866c8..7950311 100644
@@ -1,4 +1,4 @@
-SHAREDIRTEX=checkquorum
+SHAREDIRTEX=checkquorum checkquorum.wdmd
 
 include ../../make/defines.mk
 include $(OBJDIR)/make/clean.mk
cman/scripts/checkquorum.wdmd new file +104 -0

104 lines not on this page · raw message

Signature · 1 line
1.7.7.6
#2 lore raw

PATCH 2/2 checkquorum.wdmd: add integration script with wdmd

cman/scripts/checkquorum.wdmd line 30

Quoted 10 lines
cman/scripts/checkquorum.wdmd new file +10 -0
+# rpm based distros
+[ -d /etc/sysconfig ] && \
+	[ -f /etc/sysconfig/checkquorum ] && \
+	. /etc/sysconfig/checkquorum
+
+# deb based distros
+[ ! -d /etc/sysconfig ] && \
+	[ -f /etc/default/checkquorum ] && \
+	. /etc/default/checkquorum
+

FYI: Some RAID tool vendors delivers utilities for debian which creates directory '/etc/sysconfig' on debian boxes, so that test is not reliable.

#3 lore raw

PATCH 2/2 checkquorum.wdmd: add integration script with wdmd

Quoted 5 lines · Dietmar Maurer
Quoted 5 lines
cman/scripts/checkquorum.wdmd new file +5 -0
+# rpm based distros
+[ -d /etc/sysconfig ] && \
+	[ -f /etc/sysconfig/checkquorum ] && \
+	. /etc/sysconfig/checkquorum
+
Quoted 10 lines

cman/scripts/checkquorum.wdmd line 30

Quoted 5 lines
cman/scripts/checkquorum.wdmd new file +5 -0
+# deb based distros
+[ ! -d /etc/sysconfig ] && \
+	[ -f /etc/default/checkquorum ] && \
+	. /etc/default/checkquorum
+

FYI: Some RAID tool vendors delivers utilities for debian which creates directory '/etc/sysconfig' on debian boxes, so that test is not reliable.

This might be a controversial argument.

Debian policy (1) define the use of /etc/default as "should" (2), for conffile such as this one. On the other side it does not explicitly forbid the use of sysconfig.

sysconfig is not found anywhere in Debian default archive because packages to use the formal *should* policy.

If third-party applications don?t follow Debian packaging guidelines, it is possible that they might break other components as well.

Of course we can argue on the definition of "should" forever and ever :)

As upstream we follow basic guidelines, distribution packagers and porters should (pun intended ;)) make sure to provide us with porting patches (that?s also part of the Debian Maintainer duty).

Fabio

1) http://www.debian.org/doc/debian-policy/ch-opersys.html
Section 9.3.2

"To ease the burden on the system administrator, such configurable values
should not be placed directly in the script.
Instead, they should be placed in a file in /etc/default, ...."

2) http://www.thefreedictionary.com/should
should (shd)
aux.v. Past tense of shall
1. Used to express obligation or duty
....

#4 lore raw

PATCH 2/2 checkquorum.wdmd: add integration script with wdmd

Quoted 13 lines · Dietmar Maurer
Quoted 4 lines
Quoted 4 lines
cman/scripts/checkquorum.wdmd new file +4 -0
+# rpm based distros
+[ -d /etc/sysconfig ] && \
+	[ -f /etc/sysconfig/checkquorum ] && \
+	. /etc/sysconfig/checkquorum
Quoted 8 lines

cman/scripts/checkquorum.wdmd line 30

Quoted 6 lines
cman/scripts/checkquorum.wdmd new file +6 -0
+
+# deb based distros
+[ ! -d /etc/sysconfig ] && \
+	[ -f /etc/default/checkquorum ] && \
+	. /etc/default/checkquorum
+

FYI: Some RAID tool vendors delivers utilities for debian which creates

Quoted 6 lines

directory '/etc/sysconfig'

Quoted 3 lines

on debian boxes, so that test is not reliable.

This might be a controversial argument.

I just though there are better tests to see if you run on debian, for example:

[ -f /etc/debian_version && -d /etc/default ]

#5 lore raw

PATCH 2/2 checkquorum.wdmd: add integration script with wdmd

Quoted 18 lines · Dietmar Maurer
Quoted 18 lines · Dietmar Maurer
Quoted 4 lines
Quoted 4 lines
cman/scripts/checkquorum.wdmd new file +4 -0
+# rpm based distros
+[ -d /etc/sysconfig ] && \
+	[ -f /etc/sysconfig/checkquorum ] && \
+	. /etc/sysconfig/checkquorum
Quoted 8 lines

cman/scripts/checkquorum.wdmd line 30

Quoted 6 lines
cman/scripts/checkquorum.wdmd new file +6 -0
+
+# deb based distros
+[ ! -d /etc/sysconfig ] && \
+	[ -f /etc/default/checkquorum ] && \
+	. /etc/default/checkquorum
+

FYI: Some RAID tool vendors delivers utilities for debian which creates

directory '/etc/sysconfig'

Quoted 3 lines

on debian boxes, so that test is not reliable.

Quoted 6 lines
Quoted 1 line

This might be a controversial argument.

I just though there are better tests to see if you run on debian, for example:

[ -f /etc/debian_version && -d /etc/default ]

that doesn?t scale well for debian derivates that don?t ship debian_version :) (see ubuntu & co..)

You can?t even use something like "which dpkg" since the tool is available on rpm based distributions... or viceversa.. there is rpm for Debian & derivates.

hardcoding all distributions is not optimal either, as they might change policy by version....

Fabio

#6 lore raw

PATCH 2/2 checkquorum.wdmd: add integration script with wdmd

Quoted 11 lines
Quoted 2 lines

[ -f /etc/debian_version && -d /etc/default ]

that doesn?t scale well for debian derivates that don?t ship debian_version :) (see ubuntu & co..)

You can?t even use something like "which dpkg" since the tool is available on rpm based distributions... or viceversa.. there is rpm for Debian & derivates.

hardcoding all distributions is not optimal either, as they might change policy by version....

OK, I can see the problem now.

- Dietmar

#7 lore raw

PATCH 2/2 checkquorum.wdmd: add integration script with wdmd

In reply to Fabio M. Di Nitto

Am 10.10.2012 10:11, schrieb Fabio M. Di Nitto:

Quoted 4 lines

[snip]
that doesn?t scale well for debian derivates that don?t ship debian_version :) (see ubuntu & co..)

Quoted 9 lines

You can?t even use something like "which dpkg" since the tool is available on rpm based distributions... or viceversa.. there is rpm for Debian & derivates.

hardcoding all distributions is not optimal either, as they might change policy by version....

Fabio

What about 'lsb_release'? Is that executable available on all platforms?

Heiko

#8 lore raw

PATCH 2/2 checkquorum.wdmd: add integration script with wdmd

Quoted 9 lines · Heiko Nardmann

Am 10.10.2012 10:11, schrieb Fabio M. Di Nitto:

Quoted 8 lines

[snip]
that doesn?t scale well for debian derivates that don?t ship debian_version :) (see ubuntu & co..)

You can?t even use something like "which dpkg" since the tool is available on rpm based distributions... or viceversa.. there is rpm for Debian & derivates.

Quoted 7 lines
Quoted 5 lines

hardcoding all distributions is not optimal either, as they might change policy by version....

Fabio

What about 'lsb_release'? Is that executable available on all platforms?

Not installed by default, it?s generally shipped with $distro-lsb metapackage that pulls in half gazillions dependencies.

I doubt it would solve anything since you still need to parse the output. It?s really no different than hardcoding /etc/$distro_release, actually with a few GB of extra packages ;)

Fabio

#9 lore raw

PATCH 2/2 checkquorum.wdmd: add integration script with wdmd

In reply to Fabio M. Di Nitto

Will you add some documentaion how to use those scripts?

Seems those scripts does not check if the node is joined to the fence domain?

Quoted 11 lines

-----Original Message-----
From: cluster-devel-bounces at redhat.com [mailto:cluster-devel- bounces at redhat.com] On Behalf Of Fabio M. Di Nitto
Sent: Dienstag, 09. Oktober 2012 11:36
To: cluster-devel at redhat.com
Cc: Fabio M. Di Nitto
Subject: [Cluster-devel] [PATCH 2/2] checkquorum.wdmd: add integration script with wdmd

From: "Fabio M. Di Nitto" <[email protected]>

#10 lore raw

PATCH 2/2 checkquorum.wdmd: add integration script with wdmd

Quoted 1 line · Dietmar Maurer

Will you add some documentaion how to use those scripts?

Yes our documentation overlord is preparing an upstream wiki page for it. It will be ready before a release.

Quoted 3 lines

Seems those scripts does not check if the node is joined to the fence domain?

It doesn?t really need to.

I?ll put this in the easiest way as possible:

- real fencing == murder
there can only be one killer in the cluster at a time fence domain coordinates who can/should be killed by who

- checkquorum.wdmd == suicide
there are N nodes in the cluster that can decide to commit suicide without really caring about what others are doing.
this can run without any fencing configuration at all.

Anyway examples and all, setups, limitations.. all in the doc as soon as it?s ready. Be a bit patience :)

Fabio

#11 lore raw

PATCH 2/2 checkquorum.wdmd: add integration script with wdmd

Quoted 2 lines

Anyway examples and all, setups, limitations.. all in the doc as soon as it?s ready. Be a bit patience :)

Ok (I am just curios) - many thanks for you fast answers!

- Dietmar