[Pacemaker] Low cost stonith device

Johan Verrept Johan.Verrept at able.be
Mon Oct 5 12:38:33 UTC 2009


On Mon, 2009-10-05 at 14:01 +0200, Florian Haas wrote:
> > gethosts)
> > 	# print hosts with domainname
> > 	domain=`domainname`
> > 	for host in `list_devices`;
> > 	do
> > 		echo $host.$domain
> > 	done;
> 
> Can you make sure that this works both on systems where "uname -n"
> returns just the hostname (such as Debian or SuSE), and on those where
> it returns the FQDN (such as RHEL/CentOS)? I'm not sure if gethosts
> always expects to get the FQDN, or whether it expects node names as
> found in the CIB -- which, outside RHEL/CentOS, are unqualified.

Good point. The system I use returns FQDNs on "uname -n" too. It works
on those. I also use them in the CIB. I'm afraid I do not have easy
access to a Debian/SuSE cluster to test.

Perhaps something in the nature of 

if [ `uname -n` = `hostname -s` ]
then
	for host in `list_devices`;
	do
		echo $host
	done;
else
	domainname=`hostname -d`
	for host in `list_devices`;
	do
		echo $host.$domain
	done;
fi

This makes the script return the same format as "uname -n". (That much i
can test.) Modified version attached.

Btw, the use of "domainname" was a bug since this normally returns the
YP/NIS domain.

> Well spotted. But actually gethosts should return a list of
> nodenames, as they are configured in the CIB. Now, if
> list_devices, which actually uses GetPowerName.cgi, shows host
> names as they are defined by the user, I wonder why it's needed
> to append the domain. If the user wants node names with domain
> couldn't he also define them so in the stonith device?

No, this is why I added the code in the first place. The names in the
device are limited to 15 characters so there is no room for domainnames.
This is also my main gripe with the device.

	J.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ippower9258hp
Type: application/x-shellscript
Size: 5274 bytes
Desc: not available
URL: <https://lists.clusterlabs.org/pipermail/pacemaker/attachments/20091005/5c65a40f/attachment-0002.bin>


More information about the Pacemaker mailing list