Hi Alan, list members,
The attached patch (heartbeat-mult-outlet-V4.patch) updates the cyclades
STONITH module as follows:
Changelog:
* Support new PM firmware format
* Support multiple outlets connected to a single host by truncating the
comparison to the hostname length defined in the heartbeat configuration.
* Increase maximum outlet name length to 16 characters.
* Add README.cyclades file which for some reason was not incorporated
to the official heartbeat package.
Please apply.
diff -Nur heartbeat-2.0.2/lib/plugins/stonith.orig/README.cyclades
heartbeat-2.0.2/lib/plugins/stonith/README.cyclades
--- heartbeat-2.0.2/lib/plugins/stonith.orig/README.cyclades 1969-12-31
21:00:00.000000000 -0300
+++ heartbeat-2.0.2/lib/plugins/stonith/README.cyclades 2005-12-22
11:22:24.000000000 -0200
@@ -0,0 +1,61 @@
+STONITH module for Cyclades AlterPath PM
+----------------------------------------
+
+This STONITH module talks to Cyclades AlterPath PM series of power managers
+via TS, ACS or KVM equipment.
+
+Access to the frontend device (TS, ACS or KVM) is done via root user with
+passwordless ssh.
+
+For that, it is necessary to create a public/private keypar with _empty_
+passphrase on _each_ machine which is part of the cluster.
+
+Small HOWTO follows:
+
+# ssh-keygen -t rsa
+Generating public/private rsa key pair.
+Enter file in which to save the key (/root/.ssh/id_rsa):
+Created directory '/home/root/.ssh'.
+Enter passphrase (empty for no passphrase):
+Enter same passphrase again:
+Your identification has been saved in /root/.ssh/id_rsa.
+Your public key has been saved in /root/.ssh/id_rsa.pub.
+The key fingerprint is:
+dc:e0:71:55:fd:2a:b0:19:d6:3c:48:e5:45:db:b4:be [EMAIL PROTECTED]
+
+Next step is to append the public key (/root/.ssh/id_rsa.pub)
+to the authorized_keys file on the TS/ACS/KVM box. The authorized
+keys file location is set at the SSH daemon configuration file.
+The default location is /etc/ssh/authorized_keys, so:
+
[EMAIL PROTECTED] scp /root/.ssh/id_rsa.pub [EMAIL PROTECTED]:/tmp
+
+login to the TS/ACS/KVM box normally and append the public key.
+
+# ssh [EMAIL PROTECTED]
+Password: ....
+
[EMAIL PROTECTED] root]# cat /tmp/id_rsa.pub >> /etc/ssh/authorized_keys
+
+The following entries must be present on /etc/ssh/sshd_config for the
+passwordless scheme to work properly:
+
+RSAAuthentication yes
+PubkeyAuthentication yes
+AuthorizedKeysFile /etc/ssh/authorized_keys
+
+Next step is to test if the configuration has been done successfully:
+
[EMAIL PROTECTED] root]# ssh [EMAIL PROTECTED]
[EMAIL PROTECTED] root]#
+
+If it logins automatically without asking for a password, then everything
+has been done correctly!
+
+Note that such configuration procedure (including generation of the key pair)
+has to be done for each machine in the cluster which intends to use the
+AlterPath PM as a STONITH device.
+
+------
+Any questions please contact Cyclades support at <[EMAIL PROTECTED]>
+or <[EMAIL PROTECTED]>
diff -Nur heartbeat-2.0.2/lib/plugins/stonith.orig/cyclades.c
heartbeat-2.0.2/lib/plugins/stonith/cyclades.c
--- heartbeat-2.0.2/lib/plugins/stonith.orig/cyclades.c 2005-12-22
11:20:20.000000000 -0200
+++ heartbeat-2.0.2/lib/plugins/stonith/cyclades.c 2005-12-22
11:24:18.000000000 -0200
@@ -117,7 +117,8 @@
};
static struct Etoken StatusOutput[] = {
- { "Outlet\t\tName\t\tStatus\t\tUsers\t\tInterval (s)", 0, 0},
+ { "Outlet\t\tName\t\tStatus\t\tUsers\t\tInterval (s)", 1, 0},
+ { "Outlet\tName\t\t\tStatus\t\tInterval (s)\tUsers", 2, 0},
{ NULL, 0, 0}
};
@@ -234,7 +235,7 @@
char savebuf[MAXSAVE];
int err;
int outlet, numoutlet = 0;
- char name[10], locked[10], on[4];
+ char name[17], locked[10], on[4];
if (CYC_robust_cmd(sd, cmd) != S_OK) {
LOG(PIL_CRIT, "can't run status all command");
@@ -255,10 +256,10 @@
err = CYCScanLine(sd, 2, savebuf, sizeof(savebuf));
if ((err == S_OK) &&
- (sscanf(savebuf,"%3d %10s %10s %3s", &outlet,
+ (sscanf(savebuf,"%3d %16s %10s %3s", &outlet,
name, locked, on) > 0)) {
if (strstr(locked, "ocked")
- && !strcasecmp(name, host)) {
+ && !strncasecmp(name, host, strlen(host))) {
if (numoutlet >= maxoutlet) {
LOG(PIL_CRIT, "too many outlets");
return 0;
@@ -286,7 +287,7 @@
int err, i;
int outlet;
int numnames = 0;
- char name[10], locked[10], on[4];
+ char name[17], locked[10], on[4];
char *NameList[MAX_OUTLETS];
char **ret = NULL;
@@ -316,7 +317,7 @@
err = CYCScanLine(sd, 2, savebuf, sizeof(savebuf));
if ((err == S_OK) &&
- (sscanf(savebuf,"%3d %10s %10s %3s", &outlet,
+ (sscanf(savebuf,"%3d %16s %10s %3s", &outlet,
name, locked, on) > 0)) {
if (strstr(locked, "ocked")) {
nm = (char *) STRDUP (name);
@@ -401,8 +402,6 @@
return(S_OOPS);
}
- EXPECT(sd->rdfd, CRNL, 50);
-
for (i = 0; i < numoutlet; i++) {
memset(expstring, 0, sizeof(expstring));
snprintf(expstring, sizeof(expstring), "%d: Outlet turned %s."
@@ -447,8 +446,6 @@
return(S_OOPS);
}
- RESETEXPECT(sd->rdfd, CRNL, 50);
-
for (i = 0; i < numoutlet; i++) {
memset(expstring, 0, sizeof(expstring));
snprintf(expstring, sizeof(expstring)
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/