If I want a service to run once at its next opportunity, does something 
like this seem plausible?

<service_bundle type="manifest" name="myapp:myRunOnce">
     <service name="application/myapp/runOnce"
         version="1"
         type="service">
         <instance name="default" enabled="true"/>
         <exec_method
             type="method"
             name="start"
             exec="/opt/myapp/runonce; svcadm disable $SMF_FMRI"/>
         <property_group name="startd" type="framework">
             <propval name="duration" type="astring" value="transient"/>
         </property_group>
     </service>
</service_bundle>

Should I try to figure out how to delete the service too?  (It seems 
like that might be hard to do, since you can't delete a service that's 
running.)

It would be nice if there was a clearly defined run-once pattern.

Reply via email to