Child monitor level

The legacy application that I'm trying to integrate with sun cluster runs under a non-root user. I don't think there is way in PMF to do so. So in order to accomplish this I've written a wrapper shell script as START method that does something like:

su non-root-user -c "proc_mgr args".

The proc_mgr is my own version of process manager (similar to PMF) that spawns multiple child processes and respawns them in case they die.

Now the question is: I want PMF to monitor and respawn the "proc_mgr" only and nothing else. Is this possible to do this by using Child_Mon_Level property of the resource group?

[632 byte] By [dwal_007] at [2007-11-26 10:47:04]
# 1

You did not mention if you use SUNW.gds (I hope you do :).

Note that Child_mon_level is a resource property (not a resource group property).

So citing the SUNW.gds manpage:

[...]

Child_mon_level (integer)

This property provides control over the processes that

are monitored through the Process Monitor Facility

(PMF). This property denotes the level to which the

forked children processes are monitored. Omitting this

property or setting this property to the default value

is the same as omitting the -C option for pmfadm(1M):

all children (and their descendents) are monitored.

[...]

And citing the pmfadm manpage:

[...]

-C level#When starting a process, monitor it

and its children up to and including

level level#. The value of level#

must be an integer greater than or

equal to zero. The original process

executed is at level 0, its children

are executed at level 1, their chil-

dren are executed at level 2, and so

on. Any new fork operation produces

a new level of children.

This option provides more control

over which processes get monitored.

It is useful for monitoring servers

that fork new processes.

When this option is not specified,

all children are monitored, and the

original process is not restarted

until it and all its children have

died.

If a server forks new processes to

handle client requests, it might be

desirable tomonitoronlythe

server. The server needs to be res-

tarted if it dies even if some

client processes are still running.

The appropriate monitoring level is

-C 0.

If, after forking a child,the

parent exits, then it is the child

that needs monitoring. The level to

use to monitor the child is -C 1.

When both processes die, the server

is restarted.

[...]

From that the answer is yes, by setting Child_mon_level=0.

Greets

Thorsten

ThorstenFrueauf at 2007-7-7 2:59:18 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...