Quoth Jordan Brown on Mon, Jun 23, 2008 at 02:39:13PM -0700:
> 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"/>

I see two potential problems with this.  First, if runonce dies
prematurely, svc.startd won't restart it.  Second, if runonce wants to
return a specific SMF return code, it won't be able to.

> 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.)

Actually, you can, with svccfg delete -f.

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

We have had requests for one-shot services in the past.  Nobody has come
up with requirements or a design, though.


David

Reply via email to