Thanks for the tips, option 3 does look the most interesting!
I give it a go but as you assumed correctly my knowledge of Solaris is fairly limited for now.
Here is what I have so far... but I think the dependent is the part that is failing.
Some help would be appropriated but in the main time I'll keep hammering at it.
Now works... But still usb errors. Manual starting vm directly afterboot works as expected :s
Code: Select all
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type='manifest' name='vbox-needs-usb'>
<service
name='site/xvm/vbox-needs-usb'
type='service'
version='0.1'>
<create_default_instance enabled='false' />
<single_instance />
<dependent name="vbox" grouping="require_all" restart_on="none">
<service_fmri value="svc:/site/xvm/vbox"/>
</dependent>
<exec_method
type='method'
name='start'
exec='sleep 240'
timeout_seconds='250'
/>
<exec_method
type='method'
name='stop'
exec=':true'
timeout_seconds='60'
/>
<property_group name='startd' type='framework'>
<propval name='duration' type='astring' value='transient' />
</property_group>
</service>
</service_bundle>
Code: Select all
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type='manifest' name='vbox-provice-gateway'>
<service
name='site/xvm/vbox-provice-gateway'
type='service'
version='0.1'>
<create_default_instance enabled='true' />
<single_instance />
<!-- wait for vbox to be started -->
<dependency name='vbox' type='service' grouping='require_all' restart_on='none'>
<service_fmri value="svc:/site/xvm/vbox"/>
</dependency>
<!-- if a vm provides the gateway, some services fail -->
<dependent name="system-repository" grouping="require_all" restart_on="none">
<service_fmri value="svc:/application/pkg/system-repository"/>
</dependent>
<!-- wait 2 minutes to give the vm time to start -->
<exec_method
type='method'
name='start'
exec='sleep 240'
timeout_seconds='250'
/>
<exec_method
type='method'
name='stop'
exec=':true'
timeout_seconds='60'
/>
<property_group name='startd' type='framework'>
<propval name='duration' type='astring' value='transient' />
</property_group>
</service>
</service_bundle>