I have converted a legacy rc script to run via SMF.
For my method and manifest templates, I used the /lib/svc/method/postgresql and 
/var/svc/manifest/application/database/postgresql.xml.

The method script starts a Java file running in the background then immediately 
returns a 0.
(This java file is really an application that we want to start at boot time and 
not a traditional service daemon.)

Everything works fine unless there is a problem with the Java file which forces 
it to terminate with an error, returning either 95 or 96. 
(SMF_EXIT_ERR_FATAL/CONFIG)

So the sequence of events is:
1. The start method is executed
2. The start method runs a Java file in the background
3. The start method exits with a return code of 0
4. The Java file terminates with an error exit code of 95 or 96
5. The stop method is executed: "... all processes in service exited."
6. The start method script is executed
7. Repeat events 1-6 forever

I read the FAQ question ?What do I need in my manifest to keep my service from 
restarting every time it core dumps or a child process exits?? =>  
http://opensolaris.org/os/community/smf/faq/#toc54  <=

I implemented the property_group as outlined in the response but the restarter 
is still attempting to do a restart.

Questions:
Am I missing something or am I misusing the changes outlined in the FAQ?
Should I just have the java code disable itself (svcadm disable 
svc_name:svc_inst) rather than depending on SMF interpreting the return error 
code? 

Thanks
Paul W
 
 
This message posted from opensolaris.org

Reply via email to