Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux-HA: Dev

suggestions and patch for meatclient

 

 

Linux-HA dev RSS feed   Index | Next | Previous | View Threaded


satoyoshi at intellilink

Nov 13, 2009, 1:05 AM

Post #1 of 12 (2150 views)
Permalink
suggestions and patch for meatclient

Hi,

I setup glue + corosync + pacemaker. I have 3 nodes or more.
I configure STONITH plugin with ibmrsa-telnet and meatware.


When all plugins fail, action as follows, right?
1) ibmrsa-telnet -> fail
2) meatware -> fail
3) remote fencing (ibmrsa-tenlet and meatware) -> timeout
4) return 1)

in this case, the operator run "meatclient" after intervention(reset node).
"meatclient" succeeds only when plugin "meatware" is executing.
So, the operator have to always watch the logfile while STONITH is executing.
I think this operation is not simple for the operator.

Then, I want to add the option to "meatcleint" for waits next result of "meatware".
By way of trial, I made patch in glue (changeset:3297e5e11428).


I would like to hear any opinion.

Regards,
Yoshihiko SATO
Attachments: meatclient.c.patch (1.59 KB)


dejanmm at fastmail

Nov 13, 2009, 2:42 AM

Post #2 of 12 (2031 views)
Permalink
Re: suggestions and patch for meatclient [In reply to]

Hi Yoshihiko-san,

On Fri, Nov 13, 2009 at 06:05:15PM +0900, Yoshihiko SATO wrote:
> Hi,
>
> I setup glue + corosync + pacemaker. I have 3 nodes or more.
> I configure STONITH plugin with ibmrsa-telnet and meatware.
>
>
> When all plugins fail, action as follows, right?
> 1) ibmrsa-telnet -> fail
> 2) meatware -> fail
> 3) remote fencing (ibmrsa-tenlet and meatware) -> timeout
> 4) return 1)
>
> in this case, the operator run "meatclient" after intervention(reset node).
> "meatclient" succeeds only when plugin "meatware" is executing.
> So, the operator have to always watch the logfile while STONITH is executing.
> I think this operation is not simple for the operator.

True.

> Then, I want to add the option to "meatcleint" for waits next result of "meatware".
> By way of trial, I made patch in glue (changeset:3297e5e11428).
>
> I would like to hear any opinion.

Great idea! But I'd like to suggest a bit different execution,
i.e. to have usage like this:

meatclient -c node [-w]

and then to put the wait loop around the existing code. Also,
please don't print ERRORs while waiting, it may confuse the poor
sleepy operator :) The best would be to just print dots without
\n once a second so that they know that something's going on.

Cheers,

Dejan

> Regards,
> Yoshihiko SATO
>

> diff -r 3297e5e11428 lib/stonith/meatclient.c
> --- a/lib/stonith/meatclient.c Thu Nov 12 13:50:04 2009 +0100
> +++ b/lib/stonith/meatclient.c Fri Nov 13 17:24:31 2009 +0900
> @@ -37,14 +37,14 @@
> #include <stonith/stonith.h>
> #include <glib.h>
>
> -#define OPTIONS "c:"
> +#define OPTIONS "c:w:"
>
> void usage(const char * cmd);
>
> void
> usage(const char * cmd)
> {
> - fprintf(stderr, "usage: %s [-c node]\n", cmd);
> + fprintf(stderr, "usage: %s [-c node]|[-w node]\n", cmd);
> exit(S_INVAL);
> }
>
> @@ -59,6 +59,7 @@
> meatware.c as well */
> char * opthost = NULL;
> int clearhost = 0;
> + int waitmode = 0;
>
> int c, argcount;
> int errors = 0;
> @@ -74,6 +75,9 @@
> case 'c': opthost = optarg;
> ++clearhost;
> break;
> + case 'w': opthost = optarg;
> + ++waitmode;
> + break;
> default: ++errors;
> break;
> }
> @@ -135,6 +139,36 @@
> }
>
> printf("Meatware_client: reset confirmed.\n");
> + } else
> + if (waitmode) {
> + int rc, fd;
> +
> + char line[256];
> + char meatpipe[256];
> +
> + snprintf(meatpipe, 256, "%s.%s", meatpipe_pr, opthost);
> +
> + while (1) {
> + fd = open(meatpipe, O_WRONLY | O_NONBLOCK);
> + if (fd < 0) {
> + if (errno != ENOENT && errno != ENXIO) {
> + snprintf(line, sizeof(line)
> + , "Meatware_IPC failed: %s. [%d]", meatpipe, errno);
> + perror(line);
> + }
> + sleep(1);
> + } else {
> + sprintf(line, "meatware reply %s", opthost);
> + rc = write(fd, line, 256);
> + if (rc < 0) {
> + sprintf(line, "Meatware_IPC failed: %s", meatpipe);
> + perror(line);
> + exit(S_OOPS);
> + }
> + printf("Meatware_client: reset confirmed.\n");
> + break;
> + }
> + }
> }
>
> exit(S_OK);
>

> _______________________________________________________
> Linux-HA-Dev: Linux-HA-Dev [at] lists
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/

_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


lmb at suse

Nov 14, 2009, 9:58 AM

Post #3 of 12 (2014 views)
Permalink
Re: suggestions and patch for meatclient [In reply to]

On 2009-11-13T11:42:31, Dejan Muhamedagic <dejanmm [at] fastmail> wrote:

> > I would like to hear any opinion.
>
> Great idea! But I'd like to suggest a bit different execution,
> i.e. to have usage like this:

The idea is nice, but what we actually want is a "crm node
clean-down-confirmation XXX" command, that clears the CIB accordingly.

So I think stonithd isn't actually the best place to implement this.


Regards,
Lars

--
Architect Storage/HA, OPS Engineering, Novell, Inc.
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
"Experience is the name everyone gives to their mistakes." -- Oscar Wilde

_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


andrew at beekhof

Nov 15, 2009, 10:55 AM

Post #4 of 12 (2004 views)
Permalink
Re: suggestions and patch for meatclient [In reply to]

On Sat, Nov 14, 2009 at 6:58 PM, Lars Marowsky-Bree <lmb [at] suse> wrote:
> On 2009-11-13T11:42:31, Dejan Muhamedagic <dejanmm [at] fastmail> wrote:
>
>> > I would like to hear any opinion.
>>
>> Great idea! But I'd like to suggest a bit different execution,
>> i.e. to have usage like this:
>
> The idea is nice, but what we actually want is a "crm node
> clean-down-confirmation XXX" command, that clears the CIB accordingly.
>
> So I think stonithd isn't actually the best place to implement this.

Agreed.
Someone create a bug for this?
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


dejanmm at fastmail

Nov 16, 2009, 9:58 AM

Post #5 of 12 (1986 views)
Permalink
Re: suggestions and patch for meatclient [In reply to]

Hi,

On Sun, Nov 15, 2009 at 07:55:48PM +0100, Andrew Beekhof wrote:
> On Sat, Nov 14, 2009 at 6:58 PM, Lars Marowsky-Bree <lmb [at] suse> wrote:
> > On 2009-11-13T11:42:31, Dejan Muhamedagic <dejanmm [at] fastmail> wrote:
> >
> >> > I would like to hear any opinion.
> >>
> >> Great idea! But I'd like to suggest a bit different execution,
> >> i.e. to have usage like this:
> >
> > The idea is nice, but what we actually want is a "crm node
> > clean-down-confirmation XXX" command, that clears the CIB accordingly.
> >
> > So I think stonithd isn't actually the best place to implement this.
>
> Agreed.

Not sure, i.e. would that have use _without_ fencing involved.

To have this handled by CRM, crmd would have to cancel the
currently running stonith action, i.e. send the appropriate
message to stonithd. If handled by stonithd, it would have to
cancel the running stonith action and send the OK status to crmd.
It basically boils down to the same, but the former needs extra
support in crmd. Don't know how much effort that would take and
if it would make the code more complex.

BTW, this would obviate the need for this patch, but not for the
meatware plugin, since the CRM would complain if there are no
stonith resources in the configuration with fencing enabled.

Thanks,

Dejan

> Someone create a bug for this?
> _______________________________________________________
> Linux-HA-Dev: Linux-HA-Dev [at] lists
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


satoyoshi at intellilink

Nov 18, 2009, 6:53 PM

Post #6 of 12 (1913 views)
Permalink
Re: suggestions and patch for meatclient [In reply to]

Hi,

Thanks reply and advice.

> The idea is nice, but what we actually want is a "crm node
> clean-down-confirmation XXX" command, that clears the CIB accordingly.
good idea and desirable function.
However, I think that it is also good thing (and no problem) to apply patch in the meaning of enhancing "meatclient".
Of course, I implement Dejan's good advice in patch:)

So, I hope for both.

Regards,
Yoshihiko SATO

Dejan Muhamedagic wrote:
> Hi,
>
> On Sun, Nov 15, 2009 at 07:55:48PM +0100, Andrew Beekhof wrote:
>> On Sat, Nov 14, 2009 at 6:58 PM, Lars Marowsky-Bree <lmb [at] suse> wrote:
>>> On 2009-11-13T11:42:31, Dejan Muhamedagic <dejanmm [at] fastmail> wrote:
>>>
>>>>> I would like to hear any opinion.
>>>> Great idea! But I'd like to suggest a bit different execution,
>>>> i.e. to have usage like this:
>>> The idea is nice, but what we actually want is a "crm node
>>> clean-down-confirmation XXX" command, that clears the CIB accordingly.
>>>
>>> So I think stonithd isn't actually the best place to implement this.
>> Agreed.
>
> Not sure, i.e. would that have use _without_ fencing involved.
>
> To have this handled by CRM, crmd would have to cancel the
> currently running stonith action, i.e. send the appropriate
> message to stonithd. If handled by stonithd, it would have to
> cancel the running stonith action and send the OK status to crmd.
> It basically boils down to the same, but the former needs extra
> support in crmd. Don't know how much effort that would take and
> if it would make the code more complex.
>
> BTW, this would obviate the need for this patch, but not for the
> meatware plugin, since the CRM would complain if there are no
> stonith resources in the configuration with fencing enabled.
>
> Thanks,
>
> Dejan
>
>> Someone create a bug for this?
>> _______________________________________________________
>> Linux-HA-Dev: Linux-HA-Dev [at] lists
>> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
>> Home Page: http://linux-ha.org/
> _______________________________________________________
> Linux-HA-Dev: Linux-HA-Dev [at] lists
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/

_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


lmb at suse

Nov 19, 2009, 3:09 AM

Post #7 of 12 (1896 views)
Permalink
Re: suggestions and patch for meatclient [In reply to]

On 2009-11-16T18:58:12, Dejan Muhamedagic <dejanmm [at] fastmail> wrote:

> To have this handled by CRM, crmd would have to cancel the
> currently running stonith action, i.e. send the appropriate
> message to stonithd.

Sure. This also happens if the node eventually reboots and rejoins
cleanly, too, anyway.

> If handled by stonithd, it would have to cancel the running stonith
> action and send the OK status to crmd. It basically boils down to the
> same, but the former needs extra support in crmd. Don't know how much
> effort that would take and if it would make the code more complex.

This might work too, yes - basically faking a stonithd "success".
However, how do you send this if there's no currently pending STONITH,
because stonith has just timed out and been handed back to the
transitioner?

Sending the fake ack to crmd might be the right way.

> BTW, this would obviate the need for this patch, but not for the
> meatware plugin, since the CRM would complain if there are no
> stonith resources in the configuration with fencing enabled.

What I really dislike about the meatware plugin is that it needs to be
run on a specific node. It'd be much better if it could run on any
node.

And there should always be some stonith resource defined. If the manual
override existed, they could simply define external/ssh even (no need
for meatware), which would at least allow error recovery for, say, stop
failures.


Regards,
Lars

--
Architect Storage/HA, OPS Engineering, Novell, Inc.
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
"Experience is the name everyone gives to their mistakes." -- Oscar Wilde

_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


satoyoshi at intellilink

Dec 23, 2009, 5:23 PM

Post #8 of 12 (1515 views)
Permalink
Re: suggestions and patch for meatclient [In reply to]

Hi,

> The idea is nice, but what we actually want is a "crm node
> clean-down-confirmation XXX" command, that clears the CIB accordingly.

Is this option added in the future?
I think that I should solve it in the another way until this option is added to crm.
As the method, I want to add the wait option to meatclient.
I understand that meatware and meatclient become unnecessary after the option is added to crm...

I attach patch that include the advice of Dejan.


Regards,
Yoshihiko SATO

(2009/11/19 20:09), Lars Marowsky-Bree wrote:
> On 2009-11-16T18:58:12, Dejan Muhamedagic<dejanmm [at] fastmail> wrote:
>
>> To have this handled by CRM, crmd would have to cancel the
>> currently running stonith action, i.e. send the appropriate
>> message to stonithd.
>
> Sure. This also happens if the node eventually reboots and rejoins
> cleanly, too, anyway.
>
>> If handled by stonithd, it would have to cancel the running stonith
>> action and send the OK status to crmd. It basically boils down to the
>> same, but the former needs extra support in crmd. Don't know how much
>> effort that would take and if it would make the code more complex.
>
> This might work too, yes - basically faking a stonithd "success".
> However, how do you send this if there's no currently pending STONITH,
> because stonith has just timed out and been handed back to the
> transitioner?
>
> Sending the fake ack to crmd might be the right way.
>
>> BTW, this would obviate the need for this patch, but not for the
>> meatware plugin, since the CRM would complain if there are no
>> stonith resources in the configuration with fencing enabled.
>
> What I really dislike about the meatware plugin is that it needs to be
> run on a specific node. It'd be much better if it could run on any
> node.
>
> And there should always be some stonith resource defined. If the manual
> override existed, they could simply define external/ssh even (no need
> for meatware), which would at least allow error recovery for, say, stop
> failures.
>
>
> Regards,
> Lars
>
Attachments: meatclient.c.patch (3.00 KB)


dejanmm at fastmail

Dec 28, 2009, 6:53 AM

Post #9 of 12 (1471 views)
Permalink
Re: suggestions and patch for meatclient [In reply to]

Hi Yoshihiko-san,

On Thu, Dec 24, 2009 at 10:23:41AM +0900, Yoshihiko SATO wrote:
> Hi,
>
>> The idea is nice, but what we actually want is a "crm node
>> clean-down-confirmation XXX" command, that clears the CIB accordingly.
>
> Is this option added in the future?
> I think that I should solve it in the another way until this option is added to crm.
> As the method, I want to add the wait option to meatclient.
> I understand that meatware and meatclient become unnecessary after the option is added to crm...
>
> I attach patch that include the advice of Dejan.

Many thanks for the patch. Just applied it, slightly modified.

Dejan

>
> Regards,
> Yoshihiko SATO
>
> (2009/11/19 20:09), Lars Marowsky-Bree wrote:
>> On 2009-11-16T18:58:12, Dejan Muhamedagic<dejanmm [at] fastmail> wrote:
>>
>>> To have this handled by CRM, crmd would have to cancel the
>>> currently running stonith action, i.e. send the appropriate
>>> message to stonithd.
>>
>> Sure. This also happens if the node eventually reboots and rejoins
>> cleanly, too, anyway.
>>
>>> If handled by stonithd, it would have to cancel the running stonith
>>> action and send the OK status to crmd. It basically boils down to the
>>> same, but the former needs extra support in crmd. Don't know how much
>>> effort that would take and if it would make the code more complex.
>>
>> This might work too, yes - basically faking a stonithd "success".
>> However, how do you send this if there's no currently pending STONITH,
>> because stonith has just timed out and been handed back to the
>> transitioner?
>>
>> Sending the fake ack to crmd might be the right way.
>>
>>> BTW, this would obviate the need for this patch, but not for the
>>> meatware plugin, since the CRM would complain if there are no
>>> stonith resources in the configuration with fencing enabled.
>>
>> What I really dislike about the meatware plugin is that it needs to be
>> run on a specific node. It'd be much better if it could run on any
>> node.
>>
>> And there should always be some stonith resource defined. If the manual
>> override existed, they could simply define external/ssh even (no need
>> for meatware), which would at least allow error recovery for, say, stop
>> failures.
>>
>>
>> Regards,
>> Lars
>>
>
>

> diff -r 2668d74b4060 lib/stonith/meatclient.c
> --- a/lib/stonith/meatclient.c Tue Dec 22 19:12:54 2009 +0100
> +++ b/lib/stonith/meatclient.c Thu Dec 24 09:38:08 2009 +0900
> @@ -37,14 +37,14 @@
> #include <stonith/stonith.h>
> #include <glib.h>
>
> -#define OPTIONS "c:"
> +#define OPTIONS "c:w"
>
> void usage(const char * cmd);
>
> void
> usage(const char * cmd)
> {
> - fprintf(stderr, "usage: %s [-c node]\n", cmd);
> + fprintf(stderr, "usage: %s -c node [-w]\n", cmd);
> exit(S_INVAL);
> }
>
> @@ -60,7 +60,7 @@
> char * opthost = NULL;
> int clearhost = 0;
>
> - int c, argcount;
> + int c, argcount, waitmode;
> int errors = 0;
>
> if ((cmdname = strrchr(argv[0], '/')) == NULL) {
> @@ -74,12 +74,14 @@
> case 'c': opthost = optarg;
> ++clearhost;
> break;
> + case 'w': ++waitmode;
> + break;
> default: ++errors;
> break;
> }
> }
> argcount = argc - optind;
> - if (!(argcount == 0)) {
> + if (!(argcount == 0) || !opthost) {
> errors++;
> }
>
> @@ -99,29 +101,51 @@
>
> snprintf(meatpipe, 256, "%s.%s", meatpipe_pr, opthost);
>
> - fd = open(meatpipe, O_WRONLY | O_NONBLOCK);
> + if (waitmode) {
> + gboolean waited=FALSE;
> + while (1) {
> + fd = open(meatpipe, O_WRONLY | O_NONBLOCK);
> + if (fd < 0) {
> + if (errno != ENOENT && errno != ENXIO) {
> + if (waited) printf("\n");
> + snprintf(line, sizeof(line)
> + , "Meatware_IPC failed: %s", meatpipe);
> + perror(line);
> + exit(S_BADHOST);
> + }
> + printf("."); fflush(stdout); waited=TRUE;
> + sleep(1);
> + continue;
> + }
> + if (waited) printf("\n");
> + break;
> + }
>
> - if (fd < 0) {
> - snprintf(line, sizeof(line)
> - , "Meatware_IPC failed: %s", meatpipe);
> - perror(line);
> - exit(S_BADHOST);
> - }
> + } else {
> + fd = open(meatpipe, O_WRONLY | O_NONBLOCK);
>
> - printf("\nWARNING!\n\n"
> - "If node \"%s\" has not been manually power-cycled or "
> - "disconnected from all shared resources and networks, "
> - "data on shared disks may become corrupted and "
> - "migrated services might not work as expected.\n"
> - "Please verify that the name or address above "
> - "corresponds to the node you just rebooted.\n\n"
> - "PROCEED? [yN] ", opthost);
> + if (fd < 0) {
> + snprintf(line, sizeof(line)
> + , "Meatware_IPC failed: %s", meatpipe);
> + perror(line);
> + exit(S_BADHOST);
> + }
>
> - rc = scanf("%s", resp);
> + printf("\nWARNING!\n\n"
> + "If node \"%s\" has not been manually power-cycled or "
> + "disconnected from all shared resources and networks, "
> + "data on shared disks may become corrupted and "
> + "migrated services might not work as expected.\n"
> + "Please verify that the name or address above "
> + "corresponds to the node you just rebooted.\n\n"
> + "PROCEED? [yN] ", opthost);
>
> - if (rc == 0 || rc == EOF || tolower(resp[0] != 'y')) {
> - printf("Meatware_client: operation canceled.\n");
> - exit(S_INVAL);
> + rc = scanf("%s", resp);
> +
> + if (rc == 0 || rc == EOF || tolower(resp[0] != 'y')) {
> + printf("Meatware_client: operation canceled.\n");
> + exit(S_INVAL);
> + }
> }
>
> sprintf(line, "meatware reply %s", opthost);
>

> _______________________________________________________
> Linux-HA-Dev: Linux-HA-Dev [at] lists
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/

_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


satoyoshi at intellilink

Jan 6, 2010, 5:18 PM

Post #10 of 12 (1336 views)
Permalink
Re: suggestions and patch for meatclient [In reply to]

Hi Dejan,

> Many thanks for the patch. Just applied it, slightly modified.
Thank you.
I confirmed it.
"meatclient -c nodeB -w" is good.
but, "meatclient -c nodeB" (no -w option) failed.

----------
[root [at] node ~]# meatclient -c nodeB

WARNING!

If node "nodeB" has not been manually power-cycled or disconnected from all shared resources and networks, data on shared disks may become corrupted and migrated services might not work as expected.
Please verify that the name or address above corresponds to the node you just rebooted.

PROCEED? [yN] y
Meatware_IPC failed: /var/run/meatware.nodeB: Bad file descriptor
----------

I attach patch.

Regards,
Yoshihiko SATO

(2009/12/28 23:53), Dejan Muhamedagic wrote:
> Hi Yoshihiko-san,
>
> On Thu, Dec 24, 2009 at 10:23:41AM +0900, Yoshihiko SATO wrote:
>> Hi,
>>
>>> The idea is nice, but what we actually want is a "crm node
>>> clean-down-confirmation XXX" command, that clears the CIB accordingly.
>>
>> Is this option added in the future?
>> I think that I should solve it in the another way until this option is added to crm.
>> As the method, I want to add the wait option to meatclient.
>> I understand that meatware and meatclient become unnecessary after the option is added to crm...
>>
>> I attach patch that include the advice of Dejan.
>
> Many thanks for the patch. Just applied it, slightly modified.
>
> Dejan
>
>>
>> Regards,
>> Yoshihiko SATO
>>
>> (2009/11/19 20:09), Lars Marowsky-Bree wrote:
>>> On 2009-11-16T18:58:12, Dejan Muhamedagic<dejanmm [at] fastmail> wrote:
>>>
>>>> To have this handled by CRM, crmd would have to cancel the
>>>> currently running stonith action, i.e. send the appropriate
>>>> message to stonithd.
>>>
>>> Sure. This also happens if the node eventually reboots and rejoins
>>> cleanly, too, anyway.
>>>
>>>> If handled by stonithd, it would have to cancel the running stonith
>>>> action and send the OK status to crmd. It basically boils down to the
>>>> same, but the former needs extra support in crmd. Don't know how much
>>>> effort that would take and if it would make the code more complex.
>>>
>>> This might work too, yes - basically faking a stonithd "success".
>>> However, how do you send this if there's no currently pending STONITH,
>>> because stonith has just timed out and been handed back to the
>>> transitioner?
>>>
>>> Sending the fake ack to crmd might be the right way.
>>>
>>>> BTW, this would obviate the need for this patch, but not for the
>>>> meatware plugin, since the CRM would complain if there are no
>>>> stonith resources in the configuration with fencing enabled.
>>>
>>> What I really dislike about the meatware plugin is that it needs to be
>>> run on a specific node. It'd be much better if it could run on any
>>> node.
>>>
>>> And there should always be some stonith resource defined. If the manual
>>> override existed, they could simply define external/ssh even (no need
>>> for meatware), which would at least allow error recovery for, say, stop
>>> failures.
>>>
>>>
>>> Regards,
>>> Lars
>>>
>>
>>
>
>> diff -r 2668d74b4060 lib/stonith/meatclient.c
>> --- a/lib/stonith/meatclient.c Tue Dec 22 19:12:54 2009 +0100
>> +++ b/lib/stonith/meatclient.c Thu Dec 24 09:38:08 2009 +0900
>> @@ -37,14 +37,14 @@
>> #include<stonith/stonith.h>
>> #include<glib.h>
>>
>> -#define OPTIONS "c:"
>> +#define OPTIONS "c:w"
>>
>> void usage(const char * cmd);
>>
>> void
>> usage(const char * cmd)
>> {
>> - fprintf(stderr, "usage: %s [-c node]\n", cmd);
>> + fprintf(stderr, "usage: %s -c node [-w]\n", cmd);
>> exit(S_INVAL);
>> }
>>
>> @@ -60,7 +60,7 @@
>> char * opthost = NULL;
>> int clearhost = 0;
>>
>> - int c, argcount;
>> + int c, argcount, waitmode;
>> int errors = 0;
>>
>> if ((cmdname = strrchr(argv[0], '/')) == NULL) {
>> @@ -74,12 +74,14 @@
>> case 'c': opthost = optarg;
>> ++clearhost;
>> break;
>> + case 'w': ++waitmode;
>> + break;
>> default: ++errors;
>> break;
>> }
>> }
>> argcount = argc - optind;
>> - if (!(argcount == 0)) {
>> + if (!(argcount == 0) || !opthost) {
>> errors++;
>> }
>>
>> @@ -99,29 +101,51 @@
>>
>> snprintf(meatpipe, 256, "%s.%s", meatpipe_pr, opthost);
>>
>> - fd = open(meatpipe, O_WRONLY | O_NONBLOCK);
>> + if (waitmode) {
>> + gboolean waited=FALSE;
>> + while (1) {
>> + fd = open(meatpipe, O_WRONLY | O_NONBLOCK);
>> + if (fd< 0) {
>> + if (errno != ENOENT&& errno != ENXIO) {
>> + if (waited) printf("\n");
>> + snprintf(line, sizeof(line)
>> + , "Meatware_IPC failed: %s", meatpipe);
>> + perror(line);
>> + exit(S_BADHOST);
>> + }
>> + printf("."); fflush(stdout); waited=TRUE;
>> + sleep(1);
>> + continue;
>> + }
>> + if (waited) printf("\n");
>> + break;
>> + }
>>
>> - if (fd< 0) {
>> - snprintf(line, sizeof(line)
>> - , "Meatware_IPC failed: %s", meatpipe);
>> - perror(line);
>> - exit(S_BADHOST);
>> - }
>> + } else {
>> + fd = open(meatpipe, O_WRONLY | O_NONBLOCK);
>>
>> - printf("\nWARNING!\n\n"
>> - "If node \"%s\" has not been manually power-cycled or "
>> - "disconnected from all shared resources and networks, "
>> - "data on shared disks may become corrupted and "
>> - "migrated services might not work as expected.\n"
>> - "Please verify that the name or address above "
>> - "corresponds to the node you just rebooted.\n\n"
>> - "PROCEED? [yN] ", opthost);
>> + if (fd< 0) {
>> + snprintf(line, sizeof(line)
>> + , "Meatware_IPC failed: %s", meatpipe);
>> + perror(line);
>> + exit(S_BADHOST);
>> + }
>>
>> - rc = scanf("%s", resp);
>> + printf("\nWARNING!\n\n"
>> + "If node \"%s\" has not been manually power-cycled or "
>> + "disconnected from all shared resources and networks, "
>> + "data on shared disks may become corrupted and "
>> + "migrated services might not work as expected.\n"
>> + "Please verify that the name or address above "
>> + "corresponds to the node you just rebooted.\n\n"
>> + "PROCEED? [yN] ", opthost);
>>
>> - if (rc == 0 || rc == EOF || tolower(resp[0] != 'y')) {
>> - printf("Meatware_client: operation canceled.\n");
>> - exit(S_INVAL);
>> + rc = scanf("%s", resp);
>> +
>> + if (rc == 0 || rc == EOF || tolower(resp[0] != 'y')) {
>> + printf("Meatware_client: operation canceled.\n");
>> + exit(S_INVAL);
>> + }
>> }
>>
>> sprintf(line, "meatware reply %s", opthost);
>>
>
>> _______________________________________________________
>> Linux-HA-Dev: Linux-HA-Dev [at] lists
>> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
>> Home Page: http://linux-ha.org/
>
> _______________________________________________________
> Linux-HA-Dev: Linux-HA-Dev [at] lists
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/
>
Attachments: meatclient.c.patch (1.24 KB)


dejanmm at fastmail

Jan 6, 2010, 10:54 PM

Post #11 of 12 (1330 views)
Permalink
Re: suggestions and patch for meatclient [In reply to]

Hi Yoshihiko-san,

On Thu, Jan 07, 2010 at 10:18:14AM +0900, Yoshihiko SATO wrote:
> Hi Dejan,
>
> >Many thanks for the patch. Just applied it, slightly modified.
> Thank you.
> I confirmed it.
> "meatclient -c nodeB -w" is good.
> but, "meatclient -c nodeB" (no -w option) failed.

Yes, pretty obvious now that I look at the code again. Many
thanks for the patch. Applied.

Dejan

>
> ----------
> [root [at] node ~]# meatclient -c nodeB
>
> WARNING!
>
> If node "nodeB" has not been manually power-cycled or disconnected from all shared resources and networks, data on shared disks may become corrupted and migrated services might not work as expected.
> Please verify that the name or address above corresponds to the node you just rebooted.
>
> PROCEED? [yN] y
> Meatware_IPC failed: /var/run/meatware.nodeB: Bad file descriptor
> ----------
>
> I attach patch.
>
> Regards,
> Yoshihiko SATO
>
> (2009/12/28 23:53), Dejan Muhamedagic wrote:
> >Hi Yoshihiko-san,
> >
> >On Thu, Dec 24, 2009 at 10:23:41AM +0900, Yoshihiko SATO wrote:
> >>Hi,
> >>
> >>>The idea is nice, but what we actually want is a "crm node
> >>>clean-down-confirmation XXX" command, that clears the CIB accordingly.
> >>
> >>Is this option added in the future?
> >>I think that I should solve it in the another way until this option is added to crm.
> >>As the method, I want to add the wait option to meatclient.
> >>I understand that meatware and meatclient become unnecessary after the option is added to crm...
> >>
> >>I attach patch that include the advice of Dejan.
> >
> >Many thanks for the patch. Just applied it, slightly modified.
> >
> >Dejan
> >
> >>
> >>Regards,
> >>Yoshihiko SATO
> >>
> >>(2009/11/19 20:09), Lars Marowsky-Bree wrote:
> >>>On 2009-11-16T18:58:12, Dejan Muhamedagic<dejanmm [at] fastmail> wrote:
> >>>
> >>>>To have this handled by CRM, crmd would have to cancel the
> >>>>currently running stonith action, i.e. send the appropriate
> >>>>message to stonithd.
> >>>
> >>>Sure. This also happens if the node eventually reboots and rejoins
> >>>cleanly, too, anyway.
> >>>
> >>>>If handled by stonithd, it would have to cancel the running stonith
> >>>>action and send the OK status to crmd. It basically boils down to the
> >>>>same, but the former needs extra support in crmd. Don't know how much
> >>>>effort that would take and if it would make the code more complex.
> >>>
> >>>This might work too, yes - basically faking a stonithd "success".
> >>>However, how do you send this if there's no currently pending STONITH,
> >>>because stonith has just timed out and been handed back to the
> >>>transitioner?
> >>>
> >>>Sending the fake ack to crmd might be the right way.
> >>>
> >>>>BTW, this would obviate the need for this patch, but not for the
> >>>>meatware plugin, since the CRM would complain if there are no
> >>>>stonith resources in the configuration with fencing enabled.
> >>>
> >>>What I really dislike about the meatware plugin is that it needs to be
> >>>run on a specific node. It'd be much better if it could run on any
> >>>node.
> >>>
> >>>And there should always be some stonith resource defined. If the manual
> >>>override existed, they could simply define external/ssh even (no need
> >>>for meatware), which would at least allow error recovery for, say, stop
> >>>failures.
> >>>
> >>>
> >>>Regards,
> >>> Lars
> >>>
> >>
> >>
> >
> >>diff -r 2668d74b4060 lib/stonith/meatclient.c
> >>--- a/lib/stonith/meatclient.c Tue Dec 22 19:12:54 2009 +0100
> >>+++ b/lib/stonith/meatclient.c Thu Dec 24 09:38:08 2009 +0900
> >>@@ -37,14 +37,14 @@
> >> #include<stonith/stonith.h>
> >> #include<glib.h>
> >>
> >>-#define OPTIONS "c:"
> >>+#define OPTIONS "c:w"
> >>
> >> void usage(const char * cmd);
> >>
> >> void
> >> usage(const char * cmd)
> >> {
> >>- fprintf(stderr, "usage: %s [-c node]\n", cmd);
> >>+ fprintf(stderr, "usage: %s -c node [-w]\n", cmd);
> >> exit(S_INVAL);
> >> }
> >>
> >>@@ -60,7 +60,7 @@
> >> char * opthost = NULL;
> >> int clearhost = 0;
> >>
> >>- int c, argcount;
> >>+ int c, argcount, waitmode;
> >> int errors = 0;
> >>
> >> if ((cmdname = strrchr(argv[0], '/')) == NULL) {
> >>@@ -74,12 +74,14 @@
> >> case 'c': opthost = optarg;
> >> ++clearhost;
> >> break;
> >>+ case 'w': ++waitmode;
> >>+ break;
> >> default: ++errors;
> >> break;
> >> }
> >> }
> >> argcount = argc - optind;
> >>- if (!(argcount == 0)) {
> >>+ if (!(argcount == 0) || !opthost) {
> >> errors++;
> >> }
> >>
> >>@@ -99,29 +101,51 @@
> >>
> >> snprintf(meatpipe, 256, "%s.%s", meatpipe_pr, opthost);
> >>
> >>- fd = open(meatpipe, O_WRONLY | O_NONBLOCK);
> >>+ if (waitmode) {
> >>+ gboolean waited=FALSE;
> >>+ while (1) {
> >>+ fd = open(meatpipe, O_WRONLY | O_NONBLOCK);
> >>+ if (fd< 0) {
> >>+ if (errno != ENOENT&& errno != ENXIO) {
> >>+ if (waited) printf("\n");
> >>+ snprintf(line, sizeof(line)
> >>+ , "Meatware_IPC failed: %s", meatpipe);
> >>+ perror(line);
> >>+ exit(S_BADHOST);
> >>+ }
> >>+ printf("."); fflush(stdout); waited=TRUE;
> >>+ sleep(1);
> >>+ continue;
> >>+ }
> >>+ if (waited) printf("\n");
> >>+ break;
> >>+ }
> >>
> >>- if (fd< 0) {
> >>- snprintf(line, sizeof(line)
> >>- , "Meatware_IPC failed: %s", meatpipe);
> >>- perror(line);
> >>- exit(S_BADHOST);
> >>- }
> >>+ } else {
> >>+ fd = open(meatpipe, O_WRONLY | O_NONBLOCK);
> >>
> >>- printf("\nWARNING!\n\n"
> >>- "If node \"%s\" has not been manually power-cycled or "
> >>- "disconnected from all shared resources and networks, "
> >>- "data on shared disks may become corrupted and "
> >>- "migrated services might not work as expected.\n"
> >>- "Please verify that the name or address above "
> >>- "corresponds to the node you just rebooted.\n\n"
> >>- "PROCEED? [yN] ", opthost);
> >>+ if (fd< 0) {
> >>+ snprintf(line, sizeof(line)
> >>+ , "Meatware_IPC failed: %s", meatpipe);
> >>+ perror(line);
> >>+ exit(S_BADHOST);
> >>+ }
> >>
> >>- rc = scanf("%s", resp);
> >>+ printf("\nWARNING!\n\n"
> >>+ "If node \"%s\" has not been manually power-cycled or "
> >>+ "disconnected from all shared resources and networks, "
> >>+ "data on shared disks may become corrupted and "
> >>+ "migrated services might not work as expected.\n"
> >>+ "Please verify that the name or address above "
> >>+ "corresponds to the node you just rebooted.\n\n"
> >>+ "PROCEED? [yN] ", opthost);
> >>
> >>- if (rc == 0 || rc == EOF || tolower(resp[0] != 'y')) {
> >>- printf("Meatware_client: operation canceled.\n");
> >>- exit(S_INVAL);
> >>+ rc = scanf("%s", resp);
> >>+
> >>+ if (rc == 0 || rc == EOF || tolower(resp[0] != 'y')) {
> >>+ printf("Meatware_client: operation canceled.\n");
> >>+ exit(S_INVAL);
> >>+ }
> >> }
> >>
> >> sprintf(line, "meatware reply %s", opthost);
> >>
> >
> >>_______________________________________________________
> >>Linux-HA-Dev: Linux-HA-Dev [at] lists
> >>http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> >>Home Page: http://linux-ha.org/
> >
> >_______________________________________________________
> >Linux-HA-Dev: Linux-HA-Dev [at] lists
> >http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> >Home Page: http://linux-ha.org/
> >
>

> diff -r ce57c3d4ecfc lib/stonith/meatclient.c
> --- a/lib/stonith/meatclient.c Tue Dec 29 16:35:37 2009 +0100
> +++ b/lib/stonith/meatclient.c Thu Jan 07 09:36:34 2010 +0900
> @@ -99,26 +99,25 @@
> char line[256];
> char meatpipe[256];
>
> + gboolean waited=FALSE;
> +
> snprintf(meatpipe, 256, "%s.%s", meatpipe_pr, opthost);
>
> - if (waitmode) {
> - gboolean waited=FALSE;
> - while(1) {
> - fd = open(meatpipe, O_WRONLY | O_NONBLOCK);
> - if (fd >= 0)
> - break;
> - if (!waitmode || (errno != ENOENT && errno != ENXIO)) {
> - if (waited) printf("\n");
> - snprintf(line, sizeof(line)
> - , "Meatware_IPC failed: %s", meatpipe);
> - perror(line);
> - exit(S_BADHOST);
> - }
> - printf("."); fflush(stdout); waited=TRUE;
> - sleep(1);
> + while(1) {
> + fd = open(meatpipe, O_WRONLY | O_NONBLOCK);
> + if (fd >= 0)
> + break;
> + if (!waitmode || (errno != ENOENT && errno != ENXIO)) {
> + if (waited) printf("\n");
> + snprintf(line, sizeof(line)
> + , "Meatware_IPC failed: %s", meatpipe);
> + perror(line);
> + exit(S_BADHOST);
> }
> - if (waited) printf("\n");
> + printf("."); fflush(stdout); waited=TRUE;
> + sleep(1);
> }
> + if (waited) printf("\n");
>
> printf("\nWARNING!\n\n"
> "If node \"%s\" has not been manually power-cycled or "

> _______________________________________________________
> Linux-HA-Dev: Linux-HA-Dev [at] lists
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/

_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


satoyoshi at intellilink

Jan 6, 2010, 11:21 PM

Post #12 of 12 (1335 views)
Permalink
Re: suggestions and patch for meatclient [In reply to]

Hi Dejan,

Thank you for your quick response.

Cheers,

Yoshihiko SATO


(2010/01/07 15:54), Dejan Muhamedagic wrote:
> Hi Yoshihiko-san,
>
> On Thu, Jan 07, 2010 at 10:18:14AM +0900, Yoshihiko SATO wrote:
>> Hi Dejan,
>>
>>> Many thanks for the patch. Just applied it, slightly modified.
>> Thank you.
>> I confirmed it.
>> "meatclient -c nodeB -w" is good.
>> but, "meatclient -c nodeB" (no -w option) failed.
>
> Yes, pretty obvious now that I look at the code again. Many
> thanks for the patch. Applied.
>
> Dejan
>
>>
>> ----------
>> [root [at] node ~]# meatclient -c nodeB
>>
>> WARNING!
>>
>> If node "nodeB" has not been manually power-cycled or disconnected from all shared resources and networks, data on shared disks may become corrupted and migrated services might not work as expected.
>> Please verify that the name or address above corresponds to the node you just rebooted.
>>
>> PROCEED? [yN] y
>> Meatware_IPC failed: /var/run/meatware.nodeB: Bad file descriptor
>> ----------
>>
>> I attach patch.
>>
>> Regards,
>> Yoshihiko SATO
>>
>> (2009/12/28 23:53), Dejan Muhamedagic wrote:
>>> Hi Yoshihiko-san,
>>>
>>> On Thu, Dec 24, 2009 at 10:23:41AM +0900, Yoshihiko SATO wrote:
>>>> Hi,
>>>>
>>>>> The idea is nice, but what we actually want is a "crm node
>>>>> clean-down-confirmation XXX" command, that clears the CIB accordingly.
>>>>
>>>> Is this option added in the future?
>>>> I think that I should solve it in the another way until this option is added to crm.
>>>> As the method, I want to add the wait option to meatclient.
>>>> I understand that meatware and meatclient become unnecessary after the option is added to crm...
>>>>
>>>> I attach patch that include the advice of Dejan.
>>>
>>> Many thanks for the patch. Just applied it, slightly modified.
>>>
>>> Dejan
>>>
>>>>
>>>> Regards,
>>>> Yoshihiko SATO
>>>>
>>>> (2009/11/19 20:09), Lars Marowsky-Bree wrote:
>>>>> On 2009-11-16T18:58:12, Dejan Muhamedagic<dejanmm [at] fastmail> wrote:
>>>>>
>>>>>> To have this handled by CRM, crmd would have to cancel the
>>>>>> currently running stonith action, i.e. send the appropriate
>>>>>> message to stonithd.
>>>>>
>>>>> Sure. This also happens if the node eventually reboots and rejoins
>>>>> cleanly, too, anyway.
>>>>>
>>>>>> If handled by stonithd, it would have to cancel the running stonith
>>>>>> action and send the OK status to crmd. It basically boils down to the
>>>>>> same, but the former needs extra support in crmd. Don't know how much
>>>>>> effort that would take and if it would make the code more complex.
>>>>>
>>>>> This might work too, yes - basically faking a stonithd "success".
>>>>> However, how do you send this if there's no currently pending STONITH,
>>>>> because stonith has just timed out and been handed back to the
>>>>> transitioner?
>>>>>
>>>>> Sending the fake ack to crmd might be the right way.
>>>>>
>>>>>> BTW, this would obviate the need for this patch, but not for the
>>>>>> meatware plugin, since the CRM would complain if there are no
>>>>>> stonith resources in the configuration with fencing enabled.
>>>>>
>>>>> What I really dislike about the meatware plugin is that it needs to be
>>>>> run on a specific node. It'd be much better if it could run on any
>>>>> node.
>>>>>
>>>>> And there should always be some stonith resource defined. If the manual
>>>>> override existed, they could simply define external/ssh even (no need
>>>>> for meatware), which would at least allow error recovery for, say, stop
>>>>> failures.
>>>>>
>>>>>
>>>>> Regards,
>>>>> Lars
>>>>>
>>>>
>>>>
>>>
>>>> diff -r 2668d74b4060 lib/stonith/meatclient.c
>>>> --- a/lib/stonith/meatclient.c Tue Dec 22 19:12:54 2009 +0100
>>>> +++ b/lib/stonith/meatclient.c Thu Dec 24 09:38:08 2009 +0900
>>>> @@ -37,14 +37,14 @@
>>>> #include<stonith/stonith.h>
>>>> #include<glib.h>
>>>>
>>>> -#define OPTIONS "c:"
>>>> +#define OPTIONS "c:w"
>>>>
>>>> void usage(const char * cmd);
>>>>
>>>> void
>>>> usage(const char * cmd)
>>>> {
>>>> - fprintf(stderr, "usage: %s [-c node]\n", cmd);
>>>> + fprintf(stderr, "usage: %s -c node [-w]\n", cmd);
>>>> exit(S_INVAL);
>>>> }
>>>>
>>>> @@ -60,7 +60,7 @@
>>>> char * opthost = NULL;
>>>> int clearhost = 0;
>>>>
>>>> - int c, argcount;
>>>> + int c, argcount, waitmode;
>>>> int errors = 0;
>>>>
>>>> if ((cmdname = strrchr(argv[0], '/')) == NULL) {
>>>> @@ -74,12 +74,14 @@
>>>> case 'c': opthost = optarg;
>>>> ++clearhost;
>>>> break;
>>>> + case 'w': ++waitmode;
>>>> + break;
>>>> default: ++errors;
>>>> break;
>>>> }
>>>> }
>>>> argcount = argc - optind;
>>>> - if (!(argcount == 0)) {
>>>> + if (!(argcount == 0) || !opthost) {
>>>> errors++;
>>>> }
>>>>
>>>> @@ -99,29 +101,51 @@
>>>>
>>>> snprintf(meatpipe, 256, "%s.%s", meatpipe_pr, opthost);
>>>>
>>>> - fd = open(meatpipe, O_WRONLY | O_NONBLOCK);
>>>> + if (waitmode) {
>>>> + gboolean waited=FALSE;
>>>> + while (1) {
>>>> + fd = open(meatpipe, O_WRONLY | O_NONBLOCK);
>>>> + if (fd< 0) {
>>>> + if (errno != ENOENT&& errno != ENXIO) {
>>>> + if (waited) printf("\n");
>>>> + snprintf(line, sizeof(line)
>>>> + , "Meatware_IPC failed: %s", meatpipe);
>>>> + perror(line);
>>>> + exit(S_BADHOST);
>>>> + }
>>>> + printf("."); fflush(stdout); waited=TRUE;
>>>> + sleep(1);
>>>> + continue;
>>>> + }
>>>> + if (waited) printf("\n");
>>>> + break;
>>>> + }
>>>>
>>>> - if (fd< 0) {
>>>> - snprintf(line, sizeof(line)
>>>> - , "Meatware_IPC failed: %s", meatpipe);
>>>> - perror(line);
>>>> - exit(S_BADHOST);
>>>> - }
>>>> + } else {
>>>> + fd = open(meatpipe, O_WRONLY | O_NONBLOCK);
>>>>
>>>> - printf("\nWARNING!\n\n"
>>>> - "If node \"%s\" has not been manually power-cycled or "
>>>> - "disconnected from all shared resources and networks, "
>>>> - "data on shared disks may become corrupted and "
>>>> - "migrated services might not work as expected.\n"
>>>> - "Please verify that the name or address above "
>>>> - "corresponds to the node you just rebooted.\n\n"
>>>> - "PROCEED? [yN] ", opthost);
>>>> + if (fd< 0) {
>>>> + snprintf(line, sizeof(line)
>>>> + , "Meatware_IPC failed: %s", meatpipe);
>>>> + perror(line);
>>>> + exit(S_BADHOST);
>>>> + }
>>>>
>>>> - rc = scanf("%s", resp);
>>>> + printf("\nWARNING!\n\n"
>>>> + "If node \"%s\" has not been manually power-cycled or "
>>>> + "disconnected from all shared resources and networks, "
>>>> + "data on shared disks may become corrupted and "
>>>> + "migrated services might not work as expected.\n"
>>>> + "Please verify that the name or address above "
>>>> + "corresponds to the node you just rebooted.\n\n"
>>>> + "PROCEED? [yN] ", opthost);
>>>>
>>>> - if (rc == 0 || rc == EOF || tolower(resp[0] != 'y')) {
>>>> - printf("Meatware_client: operation canceled.\n");
>>>> - exit(S_INVAL);
>>>> + rc = scanf("%s", resp);
>>>> +
>>>> + if (rc == 0 || rc == EOF || tolower(resp[0] != 'y')) {
>>>> + printf("Meatware_client: operation canceled.\n");
>>>> + exit(S_INVAL);
>>>> + }
>>>> }
>>>>
>>>> sprintf(line, "meatware reply %s", opthost);
>>>>
>>>
>>>> _______________________________________________________
>>>> Linux-HA-Dev: Linux-HA-Dev [at] lists
>>>> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
>>>> Home Page: http://linux-ha.org/
>>>
>>> _______________________________________________________
>>> Linux-HA-Dev: Linux-HA-Dev [at] lists
>>> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
>>> Home Page: http://linux-ha.org/
>>>
>>
>
>> diff -r ce57c3d4ecfc lib/stonith/meatclient.c
>> --- a/lib/stonith/meatclient.c Tue Dec 29 16:35:37 2009 +0100
>> +++ b/lib/stonith/meatclient.c Thu Jan 07 09:36:34 2010 +0900
>> @@ -99,26 +99,25 @@
>> char line[256];
>> char meatpipe[256];
>>
>> + gboolean waited=FALSE;
>> +
>> snprintf(meatpipe, 256, "%s.%s", meatpipe_pr, opthost);
>>
>> - if (waitmode) {
>> - gboolean waited=FALSE;
>> - while(1) {
>> - fd = open(meatpipe, O_WRONLY | O_NONBLOCK);
>> - if (fd>= 0)
>> - break;
>> - if (!waitmode || (errno != ENOENT&& errno != ENXIO)) {
>> - if (waited) printf("\n");
>> - snprintf(line, sizeof(line)
>> - , "Meatware_IPC failed: %s", meatpipe);
>> - perror(line);
>> - exit(S_BADHOST);
>> - }
>> - printf("."); fflush(stdout); waited=TRUE;
>> - sleep(1);
>> + while(1) {
>> + fd = open(meatpipe, O_WRONLY | O_NONBLOCK);
>> + if (fd>= 0)
>> + break;
>> + if (!waitmode || (errno != ENOENT&& errno != ENXIO)) {
>> + if (waited) printf("\n");
>> + snprintf(line, sizeof(line)
>> + , "Meatware_IPC failed: %s", meatpipe);
>> + perror(line);
>> + exit(S_BADHOST);
>> }
>> - if (waited) printf("\n");
>> + printf("."); fflush(stdout); waited=TRUE;
>> + sleep(1);
>> }
>> + if (waited) printf("\n");
>>
>> printf("\nWARNING!\n\n"
>> "If node \"%s\" has not been manually power-cycled or "
>
>> _______________________________________________________
>> Linux-HA-Dev: Linux-HA-Dev [at] lists
>> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
>> Home Page: http://linux-ha.org/
>
> _______________________________________________________
> Linux-HA-Dev: Linux-HA-Dev [at] lists
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/
>

_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Linux-HA dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.