Nate Reed wrote:
In our cluster, Heartbeat is running mon. I have a mon alert script that attempts to restart the cluster using /etc/init.d/heartbeat restart.

Since mon's parent is Heartbeat, the current process gets killed before it can start a new Heartbeat process.

Here is the command I'm using in Perl:

system("(/etc/init.d/heartbeat stop &)");

I was told opening it in a subshell (the part in ()'s) would create the process without the current process as the owner, and therefore the init script would run to completion.

But it never gets to the "StartHA" command in the init script.

Any ideas? Is there a way to pass off control to an independent process that won't get killed when Heartbeat shuts down?

Restarting the cluster is kind of drastic...

But, if you really want to do it, then I'd suggest running it in a subshell without waiting for it (with an &), and setting a trap '' 15 in the shell/subshell...

Heartbeat only sends a kill -15 (SIGTERM) to its children. Only if things get really hosed does it do anything more drastic.


--
    Alan Robertson <[EMAIL PROTECTED]>

"Openness is the foundation and preservative of friendship... Let me claim from you at all times your undisguised opinions." - William Wilberforce
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to