Respawn and failover?
Sat, 21 Dec 2002 13:14:23 +0900
On Fri, Dec 20, 2002 at 06:32:15PM +0000, Lorn Kay wrote:
> >I may be missing something, but can't you achive this by
> >defining a new resource?
> Hi Horms,
> Heartbeat won't respawn these children in this case will it?
> In the case of the getty-type programs you want them to always be running
> even if they die after a connection failure or operator intervention. For
> example, if you use the command:
> killall getty
> Init will (assuming you have respawn in /etc/inittab) bring them all back.
> What if I want to have an HA server pair that only does getty-type work on
> one server (let's call it the primary) during normal operation. Now the
> primary fails, if I tell Heartbeat simply to start the getty's on the
> backup server (via a normal resource script from haresources) init will
> never know about it and will thus not restart them when they die, or when I
> forget and type "killall getty" again on the "backup" server.
getty is an interesting case because it us usually spawned directly
by init, and init handles restarting getty if it exits for any reason.
One _not recommended_ approach would be to have a heartbeat resource
that changes the run level, thus spawning the appropriate gettys.
A nicer approach would be to write a wrapper programme that handles
the gettys. Starts them up, and make sure they keep running,
untill the wrapper is shut down. You might be able to use daemon
tools to do this, though writing something yourslef should
be quite trivial.