On 2010-06-02T15:39:26, Lars Ellenberg <[email protected]> wrote:

> Most auto-backgrounding thingies also have a "foreground" mode.

No. SAP etc don't.

> BTW, the RA cannot register the pid of the background process either,
> as it only knows the pid of the process before it backgrounded itself.

It can deduce them through process trees or parsing the process table in
other ways. (Some do that anyway to make sure they kill everything on
stop.)

There's quite some value to not just monitoring the top-level process,
because it may take it quite some time to notice that some of it's
"essential" children have died and to respond accordingly - maybe only
if it next needs them.

> Unless that thing writes a pid file.
> Oh, and beware of pid recycling...
> That may happen very fast sometimes.

I'm aware of this.

But it is very unlikely that it happens within 1s - and, of course, the
process monitor can make sure the pid still belongs to the same process
(comparing the inode, for example).

> > (While we're at it, the process watcher could probably also check
> > whether the pid has gone zombie on us ...)
> It can only go zombie, if its parent still exists,
> but "forgets" to do the waitpid.
> As the shell wrapper waits for its child,
> there won't be a zombie.
> Am I misunderstanding something?

Yes. You were assuming I was working from the example shell wrapper you
suggested. Besides, if the process forks and becomes its own session
leader, it breaks the parent-child tree and waitpid no longer is
available.

I'm really unsure what's so hard to understand here: monitoring process
liveliness is obviously a good idea. The wrapper you propose can't deal
with a significant number of real-world use cases; why is that so hard
to see?



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: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to