solaris: fix SMF manifest dependency model and start method
Resolves an issue where quagga daemons restart in an infinite loop.
Quagga daemons declare a dependency on zebra that requires a restart
of the daemon when zebra restarts and they explicitly restart zebra,
which again triggers their own restart.
Restarting zebra when other daemons are started is explicitly removed,
leaving dependency management up to SMF rather than handling it in the
start method.
solaris/quagga.init.in: Remove calls to routeadm_zebra_enable, and the
routeadm_zebra_enable function.
solaris/quagga.xml.in: Set dependency zebra grouping to require_all.
Fixes: #818
Signed-off-by: Greg Troxel <gdt@ir.bbn.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
diff --git a/solaris/quagga.init.in b/solaris/quagga.init.in
index 0042624..ee3a987 100755
--- a/solaris/quagga.init.in
+++ b/solaris/quagga.init.in
@@ -146,31 +146,6 @@
echo ${args}
}
-# certain daemons need zebra
-routeadm_zebra_enable () {
-
- if [ "$DAEMON" = "zebra" ]; then
- return
- fi
-
- enable_zebra=`/usr/bin/svcprop -p \
- routing/enable_zebra $SMF_FMRI 2> /dev/null`
- if [ "$enable_zebra" != "false" ]; then
- zenabled=`/usr/bin/svcprop -p general/enabled zebra:quagga`
- zenabledt=`/usr/bin/svcprop -p general_ovr/enabled zebra:quagga`
- if [ "$zenabled" = "true" -o "$zenabledt" = "true" ]; then
- /usr/sbin/svcadm disable zebra:quagga
- /usr/sbin/svcadm enable -st zebra:quagga
- else
- /usr/sbin/svcadm enable -st zebra:quagga
- fi
- if [ "$?" != "0" ]; then
- echo "Could not enable zebra:quagga"
- exit $SMF_EXIT_ERR_FATAL
- fi
- fi
-}
-
# Include smf functions, if available. If not, define smf_present to indicate
# there is no SMF. Should allow this script to work pre-S10.
if [ -f "$SMFINCLUDE" ] ; then
@@ -247,7 +222,6 @@
if [ smf_present -a -f "$ROUTEADMINCLUDE" ]; then
handle_routeadm_upgrade $DAEMON;
DAEMON_ARGS=`routeadm_daemon_args`;
- routeadm_zebra_enable $DAEMON;
else
if [ $# -gt 0 ] ; then
shift
diff --git a/solaris/quagga.xml.in b/solaris/quagga.xml.in
index 50c52c2..60427b0 100644
--- a/solaris/quagga.xml.in
+++ b/solaris/quagga.xml.in
@@ -21,6 +21,8 @@
Copyright 2007 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
+ Copyright 2015 Joyent, Inc.
+
ident "@(#)quagga.xml 1.0 05/03/15 SMI"
-->
@@ -189,7 +191,7 @@
<!-- ensure that restart of zebra is propogated to daemon -->
<dependency
name='zebra'
- grouping='optional_all'
+ grouping='require_all'
restart_on='restart'
type='service'>
<service_fmri value='svc:/network/routing/zebra:quagga' />
@@ -320,7 +322,7 @@
<!-- ensure that restart of zebra is propogated to daemon -->
<dependency
name='zebra'
- grouping='optional_all'
+ grouping='require_all'
restart_on='restart'
type='service'>
<service_fmri value='svc:/network/routing/zebra:quagga' />
@@ -449,7 +451,7 @@
<!-- ensure that restart of zebra is propogated to daemon -->
<dependency
name='zebra'
- grouping='optional_all'
+ grouping='require_all'
restart_on='restart'
type='service'>
<service_fmri value='svc:/network/routing/zebra:quagga' />
@@ -580,7 +582,7 @@
<!-- ensure that restart of zebra is propogated to daemon -->
<dependency
name='zebra'
- grouping='optional_all'
+ grouping='require_all'
restart_on='restart'
type='service'>
<service_fmri value='svc:/network/routing/zebra:quagga' />
@@ -715,7 +717,7 @@
<!-- ensure that restart of zebra is propogated to daemon -->
<dependency
name='zebra'
- grouping='optional_all'
+ grouping='require_all'
restart_on='restart'
type='service'>
<service_fmri value='svc:/network/routing/zebra:quagga' />