Nicolas Williams wrote: > On Mon, Dec 03, 2007 at 12:34:28AM -0500, Brian Gupta wrote: >> How does SMF know how to restart mysql if I manually kill the mysql >> process(es) using "kill"? (It seems that the manifest doesn't indicate a >> restart.) >> >> This is probably just a hole in my understanding of SMF. > > SMF uses a new feature of Solaris called "process contracts" that is a > sort of process group, with the crucial feature that the contract holder > can receive notification of events like "no more processes remain in the > contract" and "a process in this contract dumped core." > > So when svc.startd starts your daemon it starts it in a new process > contract, and when that contract runs out of processes then svc.startd > will restart that service (unless it's no longer enabled, has had too > many restarts, or the start method exited with an error).
Additionally, the kernel differentiates fatal signals that come from processes in a contract from those that come from outside the contract. Unless you specify otherwise (by setting startd/ignore_error [1]), killing just a single a process in a service will cause SMF to restart the entire service. Dave [1] See svc.startd(1M)