I suppose we could have a generic run-once service which role is to disable (and delete ?) all its dependencies when it starts. Then, you could write your own service and make run-once a dependent of it; the dependency type would have to be 'optional_all'.
-- Renaud Nicolas Williams wrote: > On Fri, Jun 27, 2008 at 11:43:14AM -0700, Jordan Brown wrote: >> David Bustos wrote: >>>> 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. >> Perhaps >> exec="/opt/myapp/runonce && svcadm disable $SMF_FMRI"/> >> >> Perhaps the "svcadm disable" needs to be wrapped so that it returns SMF >> exit codes. Of course, runonce could do the disable, but I wanted to >> show it explicitly here. > > You could easily write a generic script that start methods could run. > > Such a script could run in a separate process contract and wait (via > svcprop -w) for the service to go into the online state and only then > disable and delete the service. Any other state transition (e.g., to > maintenace) should cause the script to exit. > > If you really need it, then write it and integrate it (yes, with a side > trip to the ARC). > > Nico