Roland Mainz wrote:
> How does SMF detect that a child process failed ?

svc.startd(1M) says that a contract-model service has failed if:
        o  all processes in the service exit
        o  any processes in the service produce a core dump
        o  a process outside the service sends a service process a
           fatal  signal (for example, an administrator terminates
           a service process with the pkill command)

> Note that any exit
> code from 0 ... 255 is _valid_ for shell scripts and applications and
> killing whole services just because a child process returned a non-zero
> exit code may not be a good idea (I hope it's not implemented this way).

I don't believe it is.

> The same applies to SIGTERM and other signals - shell scripts sometimes
> employ signals for communication and that includes even stuff like
> SIGTERM and SIGHUP and the child processes may not be cleaned-up
> immediately (for example if there are other events to process the
> reaping of dead children may need some time).

Here it's mixed.  Note that the rule above talks about a process outside 
the service (I presume that means in a different contract) sending a 
fatal signal (I presume that means that it's not being caught).


Reply via email to