Solaris 10 SMF - Service Restart Automatically?

Joe Phan <[email protected]>
Newsgroups gmane.os.solaris.managers
Message-ID <[email protected]>
Hi All,

In Solaris 10, I have an application (my_appl) defined from
/etc/inittab as "respawn".

I'd like to create my_appl as an SMF service, add
into SMF repository and have SMF restarter to start/restart my_appl
automatically just like /etc/inittab does.
I successfully created my_appl SMF
service and able to start/stop manually via "svcadm enable/disable" commands. 
When I terminate my_appl forcefully via "kill -9" command, SMF restarter does
not restart my_appl as I expected.

Please help if you've already been through
this.

Thank you very much,


Joe


my_appl.xml:
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<!--
        ident   "@(#)my_appl.xml   1.0     04/03/2012"
        Service
manifest for My Application 
-->

<service_bundle type='manifest'
name='my_appl'>

<service
        name='application/my_appl'
       
type='service'
        version='1'>

        <create_default_instance
enabled='false' />

        <single_instance />

        <dependency
                name='fs'
                grouping='require_all'
                restart_on='none'
                type='service'>
                        <service_fmri value='svc:/system/filesystem/local' />
        </dependency>

        <exec_method
                type='method'
                name='start'
               
exec='/opt/my_appl/my_appl_start.sh'
                timeout_seconds='60'>
        </exec_method>

        <exec_method
                type='method'
                name='stop'
               
exec='/opt/my_appl/my_appl_stop.sh'
                timeout_seconds='60'>
        </exec_method>

        <template>
                <common_name>
                        <loctext xml:lang='C'>
                        My
Application Test
                        </loctext>
               
</common_name>

                <documentation>
                       
<manpage title='snmpd' section='1M'
                           
manpath='/usr/share/man/' />
                </documentation>

       
</template>

</service>
</service_bundle>



Reference docs:
http://www.oracle.com/technetwork/server-storage/solaris/solaris-smf-wp-16790
1.pdf
http://docs.oracle.com/cd/E19253-01/817-1985/hbrunlevels-25516/index.html
http://hub.opensolaris.org/bin/download/Community+Group+smf/WebHome/smf-lisa.
pdf



________________________________
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.