Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am using SMF to manage a service under Solaris10.

This service is itself a process manager, and forks off many child processes, some of which die occasionally (or are killed for various reasons). The service process itself is very robust and never dies however.

The problem I have is that when I manually kill one of these child processes using the KILL signal, SMF will restart the main service:

[ Aug 27 08:07:06 Stopping because process received fatal signal from outside the service. ]

Is there a way I can configure SMF or the service manifest such that SMF will not kill the service if one of the service sub-processes gets killed?

TIA

share|improve this question

3 Answers 3

You need to set the following in your manifest:

<property_group name='startd' type='framework'>
    <!-- sub-process core dumps shouldn't restart session -->
    <propval name='ignore_error' type='astring' value='core,signal' />
</property_group>

Or you can do it on the fly with:

svccfg -s svc:/your/service:default
svccfg> setprop startd/ignore_error = astring:"core,signal"
svccfg> ^D
share|improve this answer
    
Thanks! I will give this a try and report back. –  aaa90210 Aug 28 '10 at 3:14
    
It appears this sort of does what I want- however while this option does stop SMF restarting the service when child processes die, it now also ignores signals/coredumps on the primary process. While the primary process is reliable, it also defeats the purpose of using SMF at all if it cant restart the primary process when it dies. –  aaa90210 Sep 2 '10 at 23:39
    
These service failures are detected by contract(4) events, so it still is able to monitor that for the process you are monitoring. –  Martin Sep 3 '10 at 17:03
1  
SMF should still notice if ALL processes for a contract go away and restart the service at that point. This is what happens with Apache if the parent process croaks. –  eirescot Sep 5 '11 at 1:13
    
when i try the "on the fly" approach I get a message - No such property group 'startd' :( –  bagheera Feb 20 '12 at 5:32

I've had the same problem just now, and was able to solve it by changing the service process itself to start the childs wrapped inside /usr/sbin/ctrun -l child <command-and-arguments>. The manifest itself uses the "child" service model.

See contract(4) and ctrun(1) for details.

share|improve this answer
    
Do you have an example of a manifest script using the child service model? –  Jason Axelson Apr 1 at 23:37

if you try the on the fly method and get No such property group 'startd' you need to add the property first.

svccfg -s svc:/your/service:default
svccfg> addpg startd framework
svccfg> setprop startd/ignore_error = astring:"core,signal"
svccfg> ^D
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.