As I think I mentioned, I need a run-once mechanism.

As it worked out, the mechanism was not far from being pretty general. 
Take a look...

The only part of it that is visible to the application that wants the 
"run once" service is application-xvm-first-boot.xml.  When an 
application wants something run once, it creates a manifest like that. 
Everything in it is boilerplate except for the instance-name (which must 
be unique) and the value of $RUN, which specifies the command to 
execute.  (The boilerplate-to-meat ratio is unfortunate, but better than 
it might be.)

runonce.xml is the framework of the service.  There's not a lot more 
there, but there's a bit.

runonce is the script that does the dirty work.  It runs the target 
program.  If the target command succeeds, runonce disables the instance. 
  If the target command fails then it records the failure and takes the 
instance into "maintenance".

Note that runonce could be changed to delete the instance, or whatever.

Any thoughts?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: application-xvm-first-boot.xml
Type: text/xml
Size: 589 bytes
Desc: not available
URL: 
<http://mail.opensolaris.org/pipermail/smf-discuss/attachments/20080702/0807d8c3/attachment.xml>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: runonce
URL: 
<http://mail.opensolaris.org/pipermail/smf-discuss/attachments/20080702/0807d8c3/attachment.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: runonce.xml
Type: text/xml
Size: 1632 bytes
Desc: not available
URL: 
<http://mail.opensolaris.org/pipermail/smf-discuss/attachments/20080702/0807d8c3/attachment-0001.xml>

Reply via email to