Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Need help with smf

MarabuntaApr 27 2017 — edited Apr 27 2017

Hi,

I try to create a service, which should run the database and keep an eye on it.

So far the script is ready to check if the database is running and send an email if anything is wrong.

I also created an xml file for smf.

The script checks if some folders and processes exist and trys to login to the db.

How does smf know that the service is online?

My script does not need much time to end. It should be restarted by smf.

I couldnt find anything here:

http://www.oracle.com/technetwork/server-storage/solaris/solaris-smf-manifest-wp-167902.pdf

SunOS 5.11 11.3 sun4v sparc sun4v

Oracle Solaris 11.3 SPARC

[ Apr 26 16:14:25 Method "start" exited with status 0. ]

[ Apr 26 16:14:25 Stopping because all processes in service exited. ]

[ Apr 26 16:14:25 Executing stop method ("/lib/svc/method/dbstart_check.sh stop"). ]

[ Apr 26 16:14:25 Method "stop" exited with status 0. ]

[ Apr 26 16:14:25 Executing start method ("/lib/svc/method/dbstart_check.sh start"). ]

[ Apr 26 16:15:25 Method "start" exited with status 0. ]

[ Apr 26 16:15:25 Stopping because all processes in service exited. ]

[ Apr 26 16:15:26 Executing stop method ("/lib/svc/method/dbstart_check.sh stop"). ]

[ Apr 26 16:15:26 Method "stop" exited with status 0. ]

[ Apr 26 16:15:26 Restarting too quickly, changing state to maintenance. ]

Here is the xml file, just tell me if you need more information

<?xml version="1.0"?>

<!DOCTYPE service_bundle

  SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">

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

  <service

    name='application/database/dbstart_check'

    type='service'

    version='1'>

    <create_default_instance enabled='true' />

    <single_instance />

    <dependency

        name='network'

        grouping='require_all'

        restart_on='none'

        type='service'>

            <service_fmri value='svc:/milestone/network:default' />

    </dependency>

    <exec_method

      type='method'

      name='start'

      exec='/lib/svc/method/dbstart_check.sh start'

      timeout_seconds='-1'>

      <method_context>

        <method_credential user='root' />

      </method_context>

    </exec_method>

    <exec_method

      type='method'

      name='status'

      exec='/lib/svc/method/dbstart_check.sh status'

      timeout_seconds='300'>

      <method_context>

        <method_credential user='root' />

      </method_context>

    </exec_method>

    <exec_method

      type='method'

      name='stop'

      exec='/lib/svc/method/dbstart_check.sh stop'

      timeout_seconds='120'>

      <method_context>

        <method_credential user='root' />

      </method_context>

    </exec_method>

   

    <exec_method

      type='method'

      name='help'

      exec='/lib/svc/method/dbstart_check.sh help'

      timeout_seconds='60'>

      <method_context>

        <method_credential user='root' />

      </method_context>

    </exec_method>

    <property_group name='startd' type='framework'>

      <propval name='duration' type='astring' value='contract' />

    </property_group>

    <template>

      <common_name>

        <loctext xml:lang='C'>

          dbstart_check_loctext

        </loctext>

      </common_name>

      <documentation>

        <doc_link name='dbstart_check_doclink' uri='http://www.google.de' />

      </documentation>

    </template>

  </service>

</service_bundle>

Thank you.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 25 2017
Added on Apr 27 2017
6 comments
391 views