renamed method script, externalized DELAY to a service property and won't override svc:/system/zones any longer since it is now declared in guesthandler-disarm as a dependent
This commit is contained in:
parent
fd121dace5
commit
711946cb72
|
@ -7,7 +7,10 @@
|
||||||
<dependency name='fs' grouping='require_all' restart_on='none' type='service'>
|
<dependency name='fs' grouping='require_all' restart_on='none' type='service'>
|
||||||
<service_fmri value='svc:/system/filesystem/local'/>
|
<service_fmri value='svc:/system/filesystem/local'/>
|
||||||
</dependency>
|
</dependency>
|
||||||
<exec_method name='start' type='method' exec='/opt/custom/bin/guesthandler.sh disarm' timeout_seconds='0'/>
|
<dependent name='zones' grouping='require_all' restart_on='none'>
|
||||||
|
<service_fmri value='svc:/system/zones'/>
|
||||||
|
</dependent>
|
||||||
|
<exec_method name='start' type='method' exec='/opt/custom/bin/svc-guesthandler disarm' timeout_seconds='0'/>
|
||||||
<exec_method name='stop' type='method' exec=':true' timeout_seconds='100'/>
|
<exec_method name='stop' type='method' exec=':true' timeout_seconds='100'/>
|
||||||
<property_group name='startd' type='framework'>
|
<property_group name='startd' type='framework'>
|
||||||
<propval name='duration' type='astring' value='transient'/>
|
<propval name='duration' type='astring' value='transient'/>
|
||||||
|
|
|
@ -7,11 +7,20 @@
|
||||||
<dependency name='vmadmd' grouping='require_all' restart_on='none' type='service'>
|
<dependency name='vmadmd' grouping='require_all' restart_on='none' type='service'>
|
||||||
<service_fmri value='svc:/system/smartdc/vmadmd:default'/>
|
<service_fmri value='svc:/system/smartdc/vmadmd:default'/>
|
||||||
</dependency>
|
</dependency>
|
||||||
<exec_method name='start' type='method' exec='/opt/custom/bin/guesthandler.sh %m' timeout_seconds='0'/>
|
<exec_method name='start' type='method' exec='/opt/custom/bin/svc-guesthandler %m' timeout_seconds='0'>
|
||||||
<exec_method name='stop' type='method' exec='/opt/custom/bin/guesthandler.sh %m' timeout_seconds='0'/>
|
<method_context>
|
||||||
|
<method_environment>
|
||||||
|
<envvar name='DELAY' value='%{config/delay}'/>
|
||||||
|
</method_environment>
|
||||||
|
</method_context>
|
||||||
|
</exec_method>
|
||||||
|
<exec_method name='stop' type='method' exec='/opt/custom/bin/svc-guesthandler %m' timeout_seconds='0'/>
|
||||||
<property_group name='startd' type='framework'>
|
<property_group name='startd' type='framework'>
|
||||||
<propval name='duration' type='astring' value='transient'/>
|
<propval name='duration' type='astring' value='transient'/>
|
||||||
</property_group>
|
</property_group>
|
||||||
|
<property_group name='config' type='eu.gerczei,guesthandler_configuration'>
|
||||||
|
<propval name='delay' type='integer' value='30'/>
|
||||||
|
</property_group>
|
||||||
<stability value='Unstable'/>
|
<stability value='Unstable'/>
|
||||||
<template>
|
<template>
|
||||||
<common_name>
|
<common_name>
|
||||||
|
|
|
@ -4,15 +4,13 @@
|
||||||
|
|
||||||
. /lib/svc/share/smf_include.sh
|
. /lib/svc/share/smf_include.sh
|
||||||
|
|
||||||
if [ -z "$SMF_FMRI" ]; then
|
if [ -z $SMF_FMRI ];
|
||||||
echo "this script can only be invoked by smf(5)"
|
then
|
||||||
exit $SMF_EXIT_ERR_NOSMF
|
print "this script can only be invoked by smf(5)"
|
||||||
|
exit $SMF_EXIT_ERR_NOSMF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ME=$(basename ${0%.sh})
|
ME=$(basename ${0#svc-})
|
||||||
|
|
||||||
# start-up delay between VMs
|
|
||||||
DELAY=30
|
|
||||||
|
|
||||||
function log {
|
function log {
|
||||||
# helper function to log arbitrary messages via syslog
|
# helper function to log arbitrary messages via syslog
|
||||||
|
@ -34,7 +32,7 @@ case $1 in
|
||||||
then
|
then
|
||||||
# successful start, log and wait
|
# successful start, log and wait
|
||||||
log $UUID managed to $1
|
log $UUID managed to $1
|
||||||
sleep $DELAY
|
sleep ${DELAY:-0}
|
||||||
else
|
else
|
||||||
# failed to start guest
|
# failed to start guest
|
||||||
log $UUID failed to $1
|
log $UUID failed to $1
|
||||||
|
@ -75,7 +73,11 @@ case $1 in
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
exit $SMF_EXIT_ERR;
|
if smf_present;
|
||||||
|
then
|
||||||
|
exit $SMF_EXIT_ERR_CONFIG;
|
||||||
|
else
|
||||||
|
print
|
||||||
esac
|
esac
|
||||||
|
|
||||||
exit $SMF_EXIT_OK
|
exit $SMF_EXIT_NODAEMON
|
32
zones.xml
32
zones.xml
|
@ -1,32 +0,0 @@
|
||||||
<?xml version='1.0'?>
|
|
||||||
<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
|
|
||||||
<service_bundle type='manifest' name='export'>
|
|
||||||
<service name='system/zones' type='service' version='0'>
|
|
||||||
<create_default_instance enabled='true'/>
|
|
||||||
<single_instance/>
|
|
||||||
<dependency name='multi-user-server' grouping='require_all' restart_on='none' type='service'>
|
|
||||||
<service_fmri value='svc:/milestone/multi-user-server'/>
|
|
||||||
</dependency>
|
|
||||||
<dependency name='metadata' grouping='require_all' restart_on='none' type='service'>
|
|
||||||
<service_fmri value='svc:/system/smartdc/metadata'/>
|
|
||||||
</dependency>
|
|
||||||
<dependency name='guesthandler-disarm' grouping='require_all' restart_on='none' type='service'>
|
|
||||||
<service_fmri value='svc:/system/guesthandler-disarm'/>
|
|
||||||
</dependency>
|
|
||||||
<exec_method name='start' type='method' exec='/lib/svc/method/svc-zones %m' timeout_seconds='0'/>
|
|
||||||
<exec_method name='stop' type='method' exec='/lib/svc/method/svc-zones %m' timeout_seconds='100'/>
|
|
||||||
<property_group name='startd' type='framework'>
|
|
||||||
<propval name='duration' type='astring' value='transient'/>
|
|
||||||
</property_group>
|
|
||||||
<stability value='Unstable'/>
|
|
||||||
<template>
|
|
||||||
<common_name>
|
|
||||||
<loctext xml:lang='C'>Zones autoboot and graceful shutdown</loctext>
|
|
||||||
</common_name>
|
|
||||||
<documentation>
|
|
||||||
<manpage title='zones' section='5' manpath='/usr/share/man'/>
|
|
||||||
<manpage title='zonecfg' section='1M' manpath='/usr/share/man'/>
|
|
||||||
</documentation>
|
|
||||||
</template>
|
|
||||||
</service>
|
|
||||||
</service_bundle>
|
|
Loading…
Reference in New Issue