--- solaris/quagga.init.in
+++ solaris/quagga.init.in
@@ -31,78 +31,6 @@
USER=@enable_user@
GROUP=@enable_group@
-# handle upgrade of daemon-args SMF property to new routeadm properties
-# used during upgrade too by routeadm.
-# relevant to S10U4+ only.
-handle_routeadm_upgrade () {
- GLOBAL_OPTIONS="PAfiug"
-
- daemon_args=`get_daemon_args $SMF_FMRI`
-
- if [ -n "$daemon_args" ]; then
- set_daemon_value_property "$SMF_FMRI" "$daemon_args" \
- "$GLOBAL_OPTIONS" "P" vty_port 0
- set_daemon_value_property "$SMF_FMRI" "$daemon_args" \
- "$GLOBAL_OPTIONS" "A" vty_address
- set_daemon_value_property "$SMF_FMRI" "$daemon_args" \
- "$GLOBAL_OPTIONS" "f" config_file
- set_daemon_value_property "$SMF_FMRI" "$daemon_args" \
- "$GLOBAL_OPTIONS" "i" pid_file
- set_daemon_value_property "$SMF_FMRI" "$daemon_args" \
- "$GLOBAL_OPTIONS" "u" user
- set_daemon_value_property "$SMF_FMRI" "$daemon_args" \
- "$GLOBAL_OPTIONS" "g" group
-
- case "$1" in
- zebra)
- set_daemon_boolean_property "$SMF_FMRI" "$daemon_args" \
- "${GLOBAL_OPTIONS}b" "b" batch true false
- ;;
- ripd|ripngd)
- set_daemon_boolean_property "$SMF_FMRI" "$daemon_args" \
- "${GLOBAL_OPTIONS}r" "r" retain true false
- ;;
- bgpd)
- set_daemon_boolean_property "$SMF_FMRI" "$daemon_args" \
- "${GLOBAL_OPTIONS}rnp" "r" retain true false
- set_daemon_boolean_property "$SMF_FMRI" "$daemon_args" \
- "${GLOBAL_OPTIONS}rnp" "n" no_kernel true false
- set_daemon_value_property "$SMF_FMRI" "$daemon_args" \
- "${GLOBAL_OPTIONS}rnp" "p" bgp_port
- esac
- clear_daemon_args $SMF_FMRI
- fi
-}
-
-upgrade_config () {
- DAEMON=$1
- # handle upgrade of SUNWzebra to Quagga
- if [ -d "/etc/quagga" -a ! -f "/etc/quagga/${DAEMON}.conf" ] ; then
- if [ -f "/etc/sfw/zebra/${DAEMON}.conf" ] ; then
- cp "/etc/sfw/zebra/${DAEMON}.conf" \
- "/etc/quagga/${DAEMON}.conf.upgrade" \
- || exit $SMF_EXIT_ERR_FATAL
- chown "${USER}:${GROUP}" "/etc/quagga/${DAEMON}.conf.upgrade" \
- || exit $SMF_EXIT_ERR_FATAL
- chmod 0600 "/etc/quagga/${DAEMON}.conf.upgrade" \
- || exit $SMF_EXIT_ERR_FATAL
- mv "/etc/quagga/${DAEMON}.conf.upgrade" "/etc/quagga/${DAEMON}.conf" \
- || exit $SMF_EXIT_ERR_FATAL
- fi
- fi
-
- if [ ! -f "/etc/quagga/${DAEMON}.conf" ] ; then
- touch "/etc/quagga/${DAEMON}.conf.new" \
- || exit $SMF_EXIT_ERR_FATAL
- chown "${USER}:${GROUP}" "/etc/quagga/${DAEMON}.conf.new" \
- || exit $SMF_EXIT_ERR_FATAL
- chmod 0600 "/etc/quagga/${DAEMON}.conf.new" \
- || exit $SMF_EXIT_ERR_FATAL
- mv "/etc/quagga/${DAEMON}.conf.new" "/etc/quagga/${DAEMON}.conf" \
- || exit $SMF_EXIT_ERR_FATAL
- fi
-}
-
# Relevant to S10+
quagga_is_globalzone () {
if [ "${QUAGGA_INIT_ZONENAME:=`/sbin/zonename`}" = "global" \
@@ -173,35 +101,11 @@
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
- . "$SMFINCLUDE";
-
- # source the SMF-routeadm include if present..
- if [ -f "$ROUTEADMINCLUDE" ] ; then
- . "$ROUTEADMINCLUDE"
- fi
-else
- # pre-SMF system, fake up any functions and exit codes
- # which SMFINCLUDE usually provides.
- smf_present () {
- return 1
- }
- SMF_EXIT_OK=0;
- SMF_EXIT_ERR_CONFIG=96;
- SMF_EXIT_ERR_FATAL=95;
-fi
-
-# if there's no SMF, set some default DAEMON_ARGS
-smf_present || DAEMON_ARGS=""
+. "$SMFINCLUDE";
+. "$ROUTEADMINCLUDE"
usage () {
- if smf_present ; then
- echo "Usage: $0 <daemon>";
- else
- echo "Usage: $0 <stop|start> <daemon> <daemon arguments>";
- fi
+ echo "Usage: $0 <daemon>";
echo "The --pid_file argument is implied";
echo "This help message: $0 <help|usage>";
}
@@ -214,12 +118,7 @@
;;
esac
-if smf_present ; then
- QUAGGA_METHOD="start"
-else
- QUAGGA_METHOD="$1"
- shift;
-fi
+QUAGGA_METHOD="start"
DAEMON="$1"
@@ -243,22 +142,9 @@
;;
esac
-# Older Quagga SMF packages pass daemon args on the commandline
-# Newer SMF routeadm model uses properties for each argument
-# so we must handle that.
-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
- DAEMON_ARGS="$@"
- fi
-fi
+DAEMON_ARGS=`routeadm_daemon_args $DAEMON`;
+routeadm_zebra_enable $DAEMON;
-upgrade_config "$DAEMON"
-
if [ ! -f "@sysconfdir@/${DAEMON}.conf" ] ; then
echo "Could not find config file, @sysconfdir@/${DAEMON}.conf"
exit $SMF_EXIT_ERR_CONFIG
--- solaris/quagga.xml.in
+++ solaris/quagga.xml.in
@@ -226,8 +226,6 @@
<!-- Identifies service as a routing service -->
<propval name='daemon' type='astring'
value='@sbindir@/ripd' />
- <propval name='legacy-daemon' type='astring'
- value='/usr/sfw/sbin/ripdstart' />
<propval name='value_authorization' type='astring'
value='solaris.smf.value.routing' />
<propval name='protocol' type='astring' value='ipv4' />
@@ -489,8 +487,6 @@
<!-- Identifies service as a routing service -->
<propval name='daemon' type='astring'
value='@sbindir@/ospfd' />
- <propval name='legacy-daemon' type='astring'
- value='/usr/sfw/sbin/ospfdstart' />
<propval name='value_authorization' type='astring'
value='solaris.smf.value.routing' />
<propval name='protocol' type='astring' value='ipv4'/>
@@ -752,8 +748,6 @@
<!-- Identifies service as a routing service -->
<propval name='daemon' type='astring'
value='@sbindir@/bgpd' />
- <propval name='legacy-daemon' type='astring'
- value='/usr/sfw/sbin/bgpdstart' />
<propval name='value_authorization' type='astring'
value='solaris.smf.value.routing' />
<property name='protocol' type='astring'>