components/quagga/patches/10-sunw-smf.patch
changeset 641 719d637aca9f
parent 640 4afec94b6313
child 642 817474c3c772
equal deleted inserted replaced
640:4afec94b6313 641:719d637aca9f
     1 --- solaris/quagga.init.in
       
     2 +++ solaris/quagga.init.in
       
     3 @@ -1,6 +1,6 @@
       
     4  #!/sbin/sh
       
     5  #
       
     6 -# Copyright 2001,2003 Sun Microsystems, Inc. All rights reserved.
       
     7 +# Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
       
     8  # Use is subject to license terms.
       
     9  #
       
    10  # This file is part of Quagga.
       
    11 @@ -25,40 +25,88 @@
       
    12  # Starts/stops the given daemon
       
    13  
       
    14  SMFINCLUDE=/lib/svc/share/smf_include.sh
       
    15 +ROUTEADMINCLUDE=/lib/svc/share/routing_include.sh
       
    16 +GLOBAL_OPTIONS="PAfiug"
       
    17  DAEMON_PATH=@sbindir@
       
    18 +USER=@enable_user@
       
    19 +GROUP=@enable_group@
       
    20  
       
    21 +# Relevant to S10+
       
    22  quagga_is_globalzone () {
       
    23 -	if [ "${QUAGGA_INIT_ZONENAME:=`/sbin/zonename`}" != "global" ]; then
       
    24 -		return 1
       
    25 -	else
       
    26 +	if [ "${QUAGGA_INIT_ZONENAME:=`/sbin/zonename`}" = "global" \
       
    27 +		-o `/sbin/zonename -t` = "exclusive" ]; then
       
    28  		return 0
       
    29 +	else
       
    30 +		return 1
       
    31  	fi
       
    32  }
       
    33  
       
    34 -# Include smf functions, if available. If not, define smf_present to indicate
       
    35 -# there is no SMF. Should allow this script to work pre-S10.
       
    36 -if [ -f "$SMFINCLUDE" ] ; then
       
    37 -	. "$SMFINCLUDE";
       
    38 -else
       
    39 -	# pre-SMF system, fake up any functions and exit codes
       
    40 -	# which SMFINCLUDE usually provides.
       
    41 -	smf_present () {
       
    42 -		return 1
       
    43 -	}
       
    44 -	SMF_EXIT_OK=0;
       
    45 -	SMF_EXIT_ERR_CONFIG=96;
       
    46 -	SMF_EXIT_ERR_FATAL=95;
       
    47 -fi
       
    48 +routeadm_daemon_args () {
       
    49 +	# globals
       
    50 +	args="`get_daemon_option_from_property $SMF_FMRI config_file f`"
       
    51 +	args="${args} `get_daemon_option_from_property $SMF_FMRI vty_port P`"
       
    52 +	args="${args} `get_daemon_option_from_property $SMF_FMRI vty_address A`"
       
    53 +	args="${args} `get_daemon_option_from_property $SMF_FMRI pid_file i`"
       
    54  	
       
    55 -# if there's no SMF, set some default DAEMON_ARGS
       
    56 -smf_present || DAEMON_ARGS=""
       
    57 +	# user and group we need for config file upgrade..
       
    58 +	SMF_USER=`get_routeadm_property $SMF_FMRI user`
       
    59 +	SMF_GROUP=`get_routeadm_property()$SMF_FMRI group`
       
    60 +	if [ "${SMF_USER}" ] ; then
       
    61 +		USER="${SMF_USER}"
       
    62 +		args="${args} -u ${SMF_USER}"
       
    63 +	fi
       
    64 +	if [ "${SMF_GROUP}" ] ; then 
       
    65 +		GROUP="${SMF_GROUP}"
       
    66 +		args="${args} -g ${SMF_GROUP}"
       
    67 +	fi
       
    68  
       
    69 -usage () {
       
    70 -	if smf_present ; then
       
    71 -		echo "Usage: $0 <daemon> <daemon arguments>";
       
    72 -	else
       
    73 -		echo "Usage: $0 <stop|start> <daemon> <daemon arguments>";
       
    74 +	case $1 in
       
    75 +	zebra)
       
    76 +		args="${args} `get_daemon_option_from_boolean_property $SMF_FMRI batch -b true`"
       
    77 +		args="${args} `get_daemon_option_from_boolean_property $SMF_FMRI retain -r true`"
       
    78 +		;;
       
    79 +	ripd|ripngd)
       
    80 +		args="${args} `get_daemon_option_from_boolean_property $SMF_FMRI retain -r true`"
       
    81 +		;;
       
    82 +	bgpd)
       
    83 +		args="${args} `get_daemon_option_from_boolean_property $SMF_FMRI retain -r true`"
       
    84 +		args="${args} `get_daemon_option_from_boolean_property $SMF_FMRI no_kernel -n true`"
       
    85 +		args="${args} `get_daemon_option_from_property $SMF_FMRI bgp_port p 179`"
       
    86 +		;;
       
    87 +	esac
       
    88 +	echo ${args}
       
    89 +}
       
    90 +
       
    91 +# certain daemons need zebra
       
    92 +routeadm_zebra_enable () {
       
    93 +
       
    94 +	if [ "$DAEMON" = "zebra" ]; then
       
    95 +		return
       
    96  	fi
       
    97 +	
       
    98 +	enable_zebra=`/usr/bin/svcprop -p \
       
    99 +		routing/enable_zebra $SMF_FMRI 2> /dev/null`
       
   100 +	if [ "$enable_zebra" != "false" ]; then
       
   101 +		zenabled=`/usr/bin/svcprop -p general/enabled zebra:quagga`
       
   102 +		zenabledt=`/usr/bin/svcprop -p general_ovr/enabled zebra:quagga`
       
   103 +		if [ "$zenabled" = "true" -o "$zenabledt" = "true" ]; then
       
   104 +			/usr/sbin/svcadm disable zebra:quagga
       
   105 +			/usr/sbin/svcadm enable -st zebra:quagga
       
   106 +		else
       
   107 +			/usr/sbin/svcadm enable -st zebra:quagga 
       
   108 +		fi
       
   109 +		if [ "$?" != "0" ]; then
       
   110 +			echo "Could not enable zebra:quagga"
       
   111 +			exit $SMF_EXIT_ERR_FATAL
       
   112 +		fi
       
   113 +	fi
       
   114 +}
       
   115 +
       
   116 +. "$SMFINCLUDE";
       
   117 +. "$ROUTEADMINCLUDE"
       
   118 +	
       
   119 +usage () {
       
   120 +	echo "Usage: $0 <daemon>";
       
   121  	echo "The --pid_file argument is implied";
       
   122  	echo "This help message: $0 <help|usage>";
       
   123  }
       
   124 @@ -67,20 +115,13 @@
       
   125  case $1 in
       
   126  	'help' | 'usage')
       
   127  		usage
       
   128 -		exit SMF_EXIT_OK
       
   129 +		exit $SMF_EXIT_OK
       
   130  		;;
       
   131  esac
       
   132  
       
   133 -if smf_present ; then
       
   134 -	QUAGGA_METHOD="start"
       
   135 -else
       
   136 -	QUAGGA_METHOD="$1"
       
   137 -	shift;
       
   138 -fi
       
   139 +QUAGGA_METHOD="start"
       
   140  
       
   141  DAEMON="$1"
       
   142 -shift
       
   143 -DAEMON_ARGS="$@"
       
   144  
       
   145  # daemon path must be given
       
   146  if [ -z "$DAEMON_PATH/$DAEMON" ]; then
       
   147 @@ -91,12 +132,9 @@
       
   148  # only bgpd is suitable for running in a non-global zone, at this
       
   149  # time.
       
   150  case "${DAEMON}" in
       
   151 -	zebra)
       
   152 -		quagga_is_globalzone || exit $SMF_EXIT_OK
       
   153 -	;;
       
   154  	bgpd)
       
   155  	;;
       
   156 -	ospfd | ospf6d | ripd | ripngd )
       
   157 +	zebra | ospfd | ospf6d | ripd | ripngd )
       
   158  		quagga_is_globalzone || exit $SMF_EXIT_OK
       
   159  	;;
       
   160  	*)
       
   161 @@ -105,6 +143,14 @@
       
   162  	;;
       
   163  esac
       
   164  
       
   165 +DAEMON_ARGS=`routeadm_daemon_args $DAEMON`;
       
   166 +routeadm_zebra_enable $DAEMON;
       
   167 +
       
   168 +if [ ! -f "@sysconfdir@/${DAEMON}.conf" ] ; then
       
   169 +	echo "Could not find config file, @sysconfdir@/${DAEMON}.conf"
       
   170 +	exit $SMF_EXIT_ERR_CONFIG
       
   171 +fi
       
   172 +
       
   173  # we need @quagga_statedir@ to exist, it probably is on tmpfs.
       
   174  if [ ! -d @quagga_statedir@ ] ; then
       
   175  	mkdir -p @quagga_statedir@
       
   176 @@ -115,7 +161,11 @@
       
   177  PIDFILE="@quagga_statedir@/${DAEMON}.pid"
       
   178  
       
   179  start () {
       
   180 -	$DAEMON_PATH/$DAEMON $DAEMON_ARGS --pid_file ${PIDFILE} &
       
   181 +	if [ ! -x "$DAEMON_PATH/$DAEMON" ] ; then
       
   182 +		echo "Error, could not find daemon, $DAEMON_PATH/$DAEMON"
       
   183 +		exit $SMF_EXIT_ERR_FATAL
       
   184 +	fi
       
   185 +	eval exec $DAEMON_PATH/$DAEMON $DAEMON_ARGS --pid_file ${PIDFILE} &
       
   186  }
       
   187  
       
   188  stop () {
       
   189 @@ -134,7 +184,7 @@
       
   190  
       
   191  *)
       
   192  	usage
       
   193 -	exit SMF_EXIT_ERR_FATAL
       
   194 +	exit $SMF_EXIT_ERR_FATAL
       
   195  	;;
       
   196  esac	
       
   197  
       
   198 --- solaris/quagga.xml.in
       
   199 +++ solaris/quagga.xml.in
       
   200 @@ -18,18 +18,20 @@
       
   201  	Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
       
   202  	02111-1307, USA.
       
   203  
       
   204 -	Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
       
   205 +	Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
       
   206  	Use is subject to license terms.
       
   207  
       
   208  	ident	"@(#)quagga.xml	1.0	05/03/15 SMI"
       
   209  -->
       
   210  
       
   211 -<service_bundle type='manifest' name='QUAGGAdaemons:quagga'>
       
   212 +<service_bundle type='manifest' name='SUNWquagga-daemons:quagga'>
       
   213 +
       
   214  <service
       
   215  	name='network/routing/zebra'
       
   216  	type='service'
       
   217  	version='1'>
       
   218 -
       
   219 +	
       
   220 +	<single_instance />
       
   221  	<instance name='quagga' enabled='false'>
       
   222  	
       
   223  	<dependency name='fs'
       
   224 @@ -46,24 +48,24 @@
       
   225  		type='service'>
       
   226  		<service_fmri value='svc:/network/initial' />
       
   227  	</dependency>
       
   228 -
       
   229 -	<dependency name='config_data'
       
   230 +	
       
   231 +	<!-- do not not run unless routing-setup has run -->
       
   232 +	<dependency
       
   233 +		name='network_routing_setup'
       
   234  		grouping='require_all'
       
   235 -		restart_on='restart'
       
   236 -		type='path'>
       
   237 -		<service_fmri
       
   238 -			value='file://localhost/@sysconfdir@/zebra.conf' />
       
   239 +		restart_on='refresh'
       
   240 +		type='service'>
       
   241 +		<service_fmri value='svc:/network/routing-setup' />
       
   242  	</dependency>
       
   243 -	
       
   244 +
       
   245  	<exec_method
       
   246  		type='method'
       
   247  		name='start'
       
   248 -		exec='/lib/svc/method/quagga zebra %{routing/daemon-args}'
       
   249 +		exec='/lib/svc/method/quagga zebra'
       
   250  		timeout_seconds='60'>
       
   251  		<method_context>
       
   252  		  <method_credential
       
   253 -		   user='root' group='root'
       
   254 -		   privileges='basic,net_icmpaccess,net_rawaccess,sys_admin,sys_net_config'/>
       
   255 +		   user='root' group='root'/>
       
   256   		</method_context>
       
   257  	</exec_method>
       
   258  
       
   259 @@ -84,11 +86,48 @@
       
   260  		<propval name='ignore_error'
       
   261  		    type='astring' value='core,signal' />
       
   262  	</property_group>
       
   263 -
       
   264 +	
       
   265 +	<!-- Properties in this group are used by routeadm (1M) -->
       
   266 +	<property_group name='routeadm' type='application'>
       
   267 +		<stability value='Unstable' />
       
   268 +		<!-- Identifies service as a routing service -->
       
   269 +		<propval name='daemon' type='astring'
       
   270 +			value='@sbindir@/zebra' />
       
   271 +		<propval name='value_authorization' type='astring'
       
   272 +			value='solaris.smf.value.routing' />
       
   273 +		<!-- zebra should not contribute to ipv4/ipv6 routing state -->
       
   274 +		<propval name='protocol' type='astring' value='zebra' />
       
   275 +	</property_group>
       
   276 +	
       
   277 +	<!-- Properties in this group are modifiable via routeadm (1M) -->
       
   278  	<property_group name='routing' type='application'>
       
   279 +		<stability value='Evolving' />
       
   280  		<propval name='value_authorization' type='astring' 
       
   281 -		         value='solaris.smf.modify.routing' />
       
   282 -		<propval name='daemon-args' type='astring' value='-P 0'/>
       
   283 +		         value='solaris.smf.value.routing' />
       
   284 +		
       
   285 +		<!-- Options common to Quagga daemons
       
   286 +		     Property names are equivalent to the long
       
   287 +		     option name, consult Quagga documentation -->
       
   288 +		<!-- The config file to use, if not the default -->
       
   289 +		<propval name='config_file' type='astring' value=''/>
       
   290 +		<!-- The vty_port to listen on if not the default.
       
   291 +		     0 to disable --> 
       
   292 +		<propval name='vty_port' type='integer' value='0' />
       
   293 +		<!-- The address to bind the VTY interface to, if not any. -->
       
   294 +		<propval name='vty_address' type='astring' value='' />
       
   295 +		<!-- The user to switch to after startup, if not the default -->
       
   296 +		<propval name='user' type='astring' value='' />
       
   297 +		<!-- The group to switch to, if not the default.
       
   298 +		     If user is specified, this defaults to a group with
       
   299 +		     same name as user -->
       
   300 +		<propval name='group' type='astring' value='' />
       
   301 +		<!-- The pidfile to use, if not the default of
       
   302 +		     @quagga_statedir@ -->
       
   303 +		<propval name='pid_file' type='astring' value='' />
       
   304 +		
       
   305 +		<!-- Options specific to zebra -->
       
   306 +		<propval name='batch' type='boolean' value='false' />
       
   307 +		<propval name='retain' type='boolean' value='false' />
       
   308  	</property_group>
       
   309  	
       
   310  	<property_group name='general' type='framework'>
       
   311 @@ -95,6 +134,8 @@
       
   312  		<!-- to start stop routing services -->
       
   313  		<propval name='action_authorization' type='astring'
       
   314  			 value='solaris.smf.manage.routing' />
       
   315 +		<propval name='value_authorization' type='astring'
       
   316 +			 value='solaris.smf.manage.routing' />
       
   317  	</property_group>
       
   318  
       
   319  	<template>
       
   320 @@ -111,7 +152,7 @@
       
   321  		</documentation>
       
   322  	</template>
       
   323  	</instance>
       
   324 -	<stability value='Evolving' />
       
   325 +	<stability value='Unstable' />
       
   326  </service>
       
   327  
       
   328  <service
       
   329 @@ -129,39 +170,40 @@
       
   330  			value='svc:/system/filesystem/usr:default' />
       
   331  	</dependency>
       
   332  
       
   333 -	<!-- Depends on Work-In-Progress, not yet in SNV
       
   334 -	<dependency name='net'
       
   335 -		grouping='require_all'
       
   336 -		restart_on='none'
       
   337 +	<dependency
       
   338 +		name='ipv4-forwarding'
       
   339 +		grouping='optional_all'
       
   340 +		restart_on='refresh'
       
   341  		type='service'>
       
   342 -		<service_fmri value='svc:/network/routing/ipv4-routing' />
       
   343 +		<service_fmri value='svc:/network/ipv4-forwarding' />
       
   344  	</dependency>
       
   345 -	-->
       
   346  	
       
   347 -	<dependency name='zebra'
       
   348 -			grouping='require_all'
       
   349 -			restart_on='restart'
       
   350 -			type='service'>
       
   351 -			<service_fmri value='svc:/network/routing/zebra:quagga' />
       
   352 -	</dependency>
       
   353 -
       
   354 -	<dependency name='config_data'
       
   355 +	<!-- do not not run unless routing-setup has run -->
       
   356 +	<dependency
       
   357 +		name='network_routing_setup'
       
   358  		grouping='require_all'
       
   359 -		restart_on='restart'
       
   360 -		type='path'>
       
   361 -		<service_fmri
       
   362 -			value='file://localhost/@sysconfdir@/ripd.conf' />
       
   363 +		restart_on='refresh'
       
   364 +		type='service'>
       
   365 +		<service_fmri value='svc:/network/routing-setup' />
       
   366  	</dependency>
       
   367  	
       
   368 +	<!-- ensure that restart of zebra is propogated to daemon -->
       
   369 +	<dependency
       
   370 +		name='zebra'
       
   371 +		grouping='optional_all'
       
   372 +		restart_on='restart'
       
   373 +		type='service'>
       
   374 +		<service_fmri value='svc:/network/routing/zebra:quagga' />
       
   375 +	</dependency>
       
   376 +
       
   377  	<exec_method
       
   378  		type='method'
       
   379  		name='start'
       
   380 -		exec='/lib/svc/method/quagga ripd %{routing/daemon-args}'
       
   381 +		exec='/lib/svc/method/quagga ripd'
       
   382  		timeout_seconds='60'>
       
   383  		<method_context>
       
   384  		  <method_credential
       
   385 -		   user='root' group='root'
       
   386 -		   privileges='basic,net_icmpaccess,net_privaddr,net_rawaccess'/>
       
   387 +		   user='root' group='root'/>
       
   388   		</method_context>
       
   389  	</exec_method>
       
   390  
       
   391 @@ -179,10 +221,42 @@
       
   392  		    type='astring' value='core,signal' />
       
   393  	</property_group>
       
   394  
       
   395 +	<!-- Properties in this group are used by routeadm (1M) -->
       
   396 +	<property_group name='routeadm' type='application'>
       
   397 +		<stability value='Unstable' />
       
   398 +		<!-- Identifies service as a routing service -->
       
   399 +		<propval name='daemon' type='astring'
       
   400 +			value='@sbindir@/ripd' />
       
   401 +		<propval name='value_authorization' type='astring'
       
   402 +			value='solaris.smf.value.routing' />
       
   403 +		<propval name='protocol' type='astring' value='ipv4' />
       
   404 +	</property_group>
       
   405 +	
       
   406 +	<!-- Properties in this group are modifiable via routeadm (1M) -->
       
   407  	<property_group name='routing' type='application'>
       
   408  		<propval name='value_authorization' type='astring' 
       
   409 -		         value='solaris.smf.modify.routing' />
       
   410 -		<propval name='daemon-args' type='astring' value='-P 0'/>
       
   411 +		         value='solaris.smf.value.routing' />
       
   412 +
       
   413 +		<!-- Options common to Quagga daemons -->
       
   414 +		<!-- The config file to use, if not the default -->
       
   415 +		<propval name='config_file' type='astring' value=''/>
       
   416 +		<!-- The vty_port to listen on if not the default.
       
   417 +		     0 to disable --> 
       
   418 +		<propval name='vty_port' type='integer' value='0' />
       
   419 +		<!-- The address to bind the VTY interface to, if not any. -->
       
   420 +		<propval name='vty_address' type='astring' value='' />
       
   421 +		<!-- The user to switch to after startup, if not the default -->
       
   422 +		<propval name='user' type='astring' value='' />
       
   423 +		<!-- The group to switch to, if not the default.
       
   424 +		     If user is specified, this defaults to a group with
       
   425 +		     same name as user -->
       
   426 +		<propval name='group' type='astring' value='' />
       
   427 +		<!-- The pidfile to use, if not the default of
       
   428 +		     @quagga_statedir@ -->
       
   429 +		<propval name='pid_file' type='astring' value='' />
       
   430 +		
       
   431 +		<!-- Options specific to ripd -->
       
   432 +		<propval name='retain' type='boolean' value='false' />
       
   433  	</property_group>
       
   434  
       
   435  	<property_group name='general' type='framework'>
       
   436 @@ -189,6 +263,8 @@
       
   437  		<!-- to start stop routing services -->
       
   438  		<propval name='action_authorization' type='astring'
       
   439  			 value='solaris.smf.manage.routing' />
       
   440 +		<propval name='value_authorization' type='astring'
       
   441 +			 value='solaris.smf.manage.routing' />
       
   442  	</property_group>
       
   443  
       
   444  	<template>
       
   445 @@ -205,7 +281,7 @@
       
   446  		</documentation>
       
   447  	</template>
       
   448  	</instance>
       
   449 -	<stability value='Evolving' />
       
   450 +	<stability value='Unstable' />
       
   451  </service>
       
   452  
       
   453  <service
       
   454 @@ -223,39 +299,40 @@
       
   455  			value='svc:/system/filesystem/usr:default' />
       
   456  	</dependency>
       
   457  	
       
   458 -	<!-- Depends on WIP, not yet in SNV
       
   459 -	<dependency name='net'
       
   460 -		grouping='require_all'
       
   461 -		restart_on='none'
       
   462 +	<dependency
       
   463 +		name='ipv6-forwarding'
       
   464 +		grouping='optional_all'
       
   465 +		restart_on='refresh'
       
   466  		type='service'>
       
   467 -		<service_fmri value='svc:/network/routing/ipv6-routing' />
       
   468 +		<service_fmri value='svc:/network/ipv6-forwarding' />
       
   469  	</dependency>
       
   470 -	-->
       
   471  
       
   472 -	<dependency name='zebra'
       
   473 -			grouping='require_all'
       
   474 -			restart_on='restart'
       
   475 -			type='service'>
       
   476 -			<service_fmri value='svc:/network/routing/zebra:quagga' />
       
   477 +	<!-- do not not run unless routing-setup has run -->
       
   478 +	<dependency
       
   479 +		name='network_routing_setup'
       
   480 +		grouping='require_all'
       
   481 +		restart_on='refresh'
       
   482 +		type='service'>
       
   483 +		<service_fmri value='svc:/network/routing-setup' />
       
   484  	</dependency>
       
   485  
       
   486 -	<dependency name='config_data'
       
   487 -		grouping='require_all'
       
   488 +	<!-- ensure that restart of zebra is propogated to daemon -->
       
   489 +	<dependency
       
   490 +		name='zebra'
       
   491 +		grouping='optional_all'
       
   492  		restart_on='restart'
       
   493 -		type='path'>
       
   494 -		<service_fmri
       
   495 -			value='file://localhost/@sysconfdir@/ripngd.conf' />
       
   496 +		type='service'>
       
   497 +		<service_fmri value='svc:/network/routing/zebra:quagga' />
       
   498  	</dependency>
       
   499 -	
       
   500 +
       
   501  	<exec_method
       
   502  		type='method'
       
   503  		name='start'
       
   504 -		exec='/lib/svc/method/quagga ripngd %{routing/daemon-args}'
       
   505 +		exec='/lib/svc/method/quagga ripngd'
       
   506  		timeout_seconds='60'>
       
   507  		<method_context>
       
   508  		  <method_credential
       
   509 -		   user='root' group='root'
       
   510 -		   privileges='basic,net_icmpaccess,net_privaddr,net_rawaccess'/>
       
   511 +		   user='root' group='root'/>
       
   512   		</method_context>
       
   513  	</exec_method>
       
   514  
       
   515 @@ -273,10 +350,42 @@
       
   516  		    type='astring' value='core,signal' />
       
   517  	</property_group>
       
   518  
       
   519 +	<!-- Properties in this group are used by routeadm (1M) -->
       
   520 +	<property_group name='routeadm' type='application'>
       
   521 +		<stability value='Unstable' />
       
   522 +		<!-- Identifies service as a routing service -->
       
   523 +		<propval name='daemon' type='astring'
       
   524 +			value='@sbindir@/ripngd' />
       
   525 +		<propval name='value_authorization' type='astring'
       
   526 +			value='solaris.smf.value.routing' />
       
   527 +		<propval name='protocol' type='astring' value='ipv6'/>
       
   528 +	</property_group>
       
   529 +	
       
   530 +	<!-- Properties in this group are modifiable via routeadm (1M) -->
       
   531  	<property_group name='routing' type='application'>
       
   532  		<propval name='value_authorization' type='astring' 
       
   533 -		         value='solaris.smf.modify.routing' />
       
   534 -		<propval name='daemon-args' type='astring' value='-P 0'/>
       
   535 +		         value='solaris.smf.value.routing' />
       
   536 +
       
   537 +		<!-- Options common to Quagga daemons -->
       
   538 +		<!-- The config file to use, if not the default -->
       
   539 +		<propval name='config_file' type='astring' value=''/>
       
   540 +		<!-- The vty_port to listen on if not the default.
       
   541 +		     0 to disable --> 
       
   542 +		<propval name='vty_port' type='integer' value='0' />
       
   543 +		<!-- The address to bind the VTY interface to, if not any. -->
       
   544 +		<propval name='vty_address' type='astring' value='' />
       
   545 +		<!-- The user to switch to after startup, if not the default -->
       
   546 +		<propval name='user' type='astring' value='' />
       
   547 +		<!-- The group to switch to, if not the default.
       
   548 +		     If user is specified, this defaults to a group with
       
   549 +		     same name as user -->
       
   550 +		<propval name='group' type='astring' value='' />
       
   551 +		<!-- The pidfile to use, if not the default of
       
   552 +		     @quagga_statedir@ -->
       
   553 +		<propval name='pid_file' type='astring' value='' />
       
   554 +
       
   555 +		<!-- Options specific to ripngd -->
       
   556 +		<propval name='retain' type='boolean' value='false' />
       
   557  	</property_group>
       
   558  
       
   559  	<property_group name='general' type='framework'>
       
   560 @@ -283,6 +392,8 @@
       
   561  		<!-- to start stop routing services -->
       
   562  		<propval name='action_authorization' type='astring'
       
   563  			 value='solaris.smf.manage.routing' />
       
   564 +		<propval name='value_authorization' type='astring'
       
   565 +			 value='solaris.smf.manage.routing' />
       
   566  	</property_group>
       
   567  
       
   568  	<template>
       
   569 @@ -299,7 +410,7 @@
       
   570  		</documentation>
       
   571  	</template>
       
   572  	</instance>
       
   573 -	<stability value='Evolving' />
       
   574 +	<stability value='Unstable' />
       
   575  </service>
       
   576  
       
   577  <service
       
   578 @@ -317,47 +428,51 @@
       
   579  			value='svc:/system/filesystem/usr:default' />
       
   580  	</dependency>
       
   581  	
       
   582 -	<!-- Depends on WIP, not yet in SNV
       
   583 -	<dependency name='net'
       
   584 -		grouping='require_all'
       
   585 -		restart_on='none'
       
   586 +	<dependency
       
   587 +		name='ipv4-forwarding'
       
   588 +		grouping='optional_all'
       
   589 +		restart_on='refresh'
       
   590  		type='service'>
       
   591 -		<service_fmri value='svc:/network/routing/ipv4-routing' />
       
   592 +		<service_fmri value='svc:/network/ipv4-forwarding' />
       
   593  	</dependency>
       
   594 -	-->
       
   595  
       
   596 -	<dependency name='zebra'
       
   597 -			grouping='require_all'
       
   598 -			restart_on='restart'
       
   599 -			type='service'>
       
   600 -			<service_fmri value='svc:/network/routing/zebra:quagga' />
       
   601 +	<!-- do not not run unless routing-setup has run -->
       
   602 +	<dependency
       
   603 +		name='network_routing_setup'
       
   604 +		grouping='require_all'
       
   605 +		restart_on='refresh'
       
   606 +		type='service'>
       
   607 +		<service_fmri value='svc:/network/routing-setup' />
       
   608  	</dependency>
       
   609  
       
   610 -	<dependency name='config_data'
       
   611 -		grouping='require_all'
       
   612 +	<!-- ensure that restart of zebra is propogated to daemon -->
       
   613 +	<dependency
       
   614 +		name='zebra'
       
   615 +		grouping='optional_all'
       
   616  		restart_on='restart'
       
   617 -		type='path'>
       
   618 -		<service_fmri
       
   619 -			value='file://localhost/@sysconfdir@/ospfd.conf' />
       
   620 +		type='service'>
       
   621 +		<service_fmri value='svc:/network/routing/zebra:quagga' />
       
   622  	</dependency>
       
   623 -	
       
   624 +
       
   625  	<exec_method
       
   626  		type='method'
       
   627  		name='start'
       
   628 -		exec='/lib/svc/method/quagga ospfd %{routing/daemon-args}'
       
   629 +		exec='/lib/svc/method/quagga ospfd'
       
   630  		timeout_seconds='60'>
       
   631  		<method_context>
       
   632  		  <method_credential
       
   633 -		   user='root' group='root'
       
   634 -		   privileges='basic,net_icmpaccess,net_privaddr,net_rawaccess,sys_net_config'/>
       
   635 +		   user='root' group='root'/>
       
   636   		</method_context>
       
   637  	</exec_method>
       
   638  
       
   639 +	<!-- ospfd can take a long time to shutdown, due to graceful 
       
   640 +	     shutdown 
       
   641 +	 -->
       
   642  	<exec_method
       
   643  		type='method'
       
   644  		name='stop'
       
   645  		exec=':kill'
       
   646 -		timeout_seconds='60'>
       
   647 +		timeout_seconds='600'>
       
   648  	</exec_method>
       
   649  
       
   650  	<property_group name='startd'
       
   651 @@ -367,10 +482,39 @@
       
   652  		    type='astring' value='core,signal' />
       
   653  	</property_group>
       
   654  
       
   655 +	<!-- Properties in this group are used by routeadm (1M) -->
       
   656 +	<property_group name='routeadm' type='application'>
       
   657 +		<stability value='Unstable' />
       
   658 +		<!-- Identifies service as a routing service -->
       
   659 +		<propval name='daemon' type='astring'
       
   660 +			value='@sbindir@/ospfd' />
       
   661 +		<propval name='value_authorization' type='astring'
       
   662 +			value='solaris.smf.value.routing' />
       
   663 +		<propval name='protocol' type='astring' value='ipv4'/>
       
   664 +	</property_group>
       
   665 +	
       
   666 +	<!-- Properties in this group are modifiable via routeadm (1M) -->
       
   667  	<property_group name='routing' type='application'>
       
   668  		<propval name='value_authorization' type='astring' 
       
   669 -		         value='solaris.smf.modify.routing' />
       
   670 -		<propval name='daemon-args' type='astring' value='-P 0'/>
       
   671 +		         value='solaris.smf.value.routing' />
       
   672 +
       
   673 +		<!-- Options common to Quagga daemons -->
       
   674 +		<!-- The config file to use, if not the default -->
       
   675 +		<propval name='config_file' type='astring' value=''/>
       
   676 +		<!-- The vty_port to listen on if not the default.
       
   677 +		     0 to disable --> 
       
   678 +		<propval name='vty_port' type='integer' value='0' />
       
   679 +		<!-- The address to bind the VTY interface to, if not any. -->
       
   680 +		<propval name='vty_address' type='astring' value='' />
       
   681 +		<!-- The user to switch to after startup, if not the default -->
       
   682 +		<propval name='user' type='astring' value='' />
       
   683 +		<!-- The group to switch to, if not the default.
       
   684 +		     If user is specified, this defaults to a group with
       
   685 +		     same name as user -->
       
   686 +		<propval name='group' type='astring' value='' />
       
   687 +		<!-- The pidfile to use, if not the default of
       
   688 +		     @quagga_statedir@ -->
       
   689 +		<propval name='pid_file' type='astring' value='' />
       
   690  	</property_group>
       
   691  
       
   692  	<property_group name='general' type='framework'>
       
   693 @@ -377,6 +521,8 @@
       
   694  		<!-- to start stop routing services -->
       
   695  		<propval name='action_authorization' type='astring'
       
   696  			 value='solaris.smf.manage.routing' />
       
   697 +		<propval name='value_authorization' type='astring'
       
   698 +			 value='solaris.smf.manage.routing' />
       
   699  	</property_group>
       
   700  
       
   701  	<template>
       
   702 @@ -393,7 +539,7 @@
       
   703  		</documentation>
       
   704  	</template>
       
   705  	</instance>
       
   706 -	<stability value='Evolving' />
       
   707 +	<stability value='Unstable' />
       
   708  </service>
       
   709  
       
   710  <service
       
   711 @@ -411,39 +557,40 @@
       
   712  			value='svc:/system/filesystem/usr:default' />
       
   713  	</dependency>
       
   714  	
       
   715 -	<!-- Depends on WIP, not yet in SNV
       
   716 -	<dependency name='net'
       
   717 -		grouping='require_all'
       
   718 -		restart_on='none'
       
   719 +	<dependency
       
   720 +		name='ipv6-forwarding'
       
   721 +		grouping='optional_all'
       
   722 +		restart_on='refresh'
       
   723  		type='service'>
       
   724 -		<service_fmri value='svc:/network/routing/ipv6-routing' />
       
   725 +		<service_fmri value='svc:/network/ipv6-forwarding' />
       
   726  	</dependency>
       
   727 -	-->
       
   728  
       
   729 -	<dependency name='zebra'
       
   730 -			grouping='require_all'
       
   731 -			restart_on='restart'
       
   732 -			type='service'>
       
   733 -			<service_fmri value='svc:/network/routing/zebra:quagga' />
       
   734 +	<!-- do not not run unless routing-setup has run -->
       
   735 +	<dependency
       
   736 +		name='network_routing_setup'
       
   737 +		grouping='require_all'
       
   738 +		restart_on='refresh'
       
   739 +		type='service'>
       
   740 +		<service_fmri value='svc:/network/routing-setup' />
       
   741  	</dependency>
       
   742  
       
   743 -	<dependency name='config_data'
       
   744 -		grouping='require_all'
       
   745 +	<!-- ensure that restart of zebra is propogated to daemon -->
       
   746 +	<dependency
       
   747 +		name='zebra'
       
   748 +		grouping='optional_all'
       
   749  		restart_on='restart'
       
   750 -		type='path'>
       
   751 -		<service_fmri
       
   752 -			value='file://localhost/@sysconfdir@/ospf6d.conf' />
       
   753 +		type='service'>
       
   754 +		<service_fmri value='svc:/network/routing/zebra:quagga' />
       
   755  	</dependency>
       
   756 -	
       
   757 +
       
   758  	<exec_method
       
   759  		type='method'
       
   760  		name='start'
       
   761 -		exec='/lib/svc/method/quagga ospf6d %{routing/daemon-args}'
       
   762 +		exec='/lib/svc/method/quagga ospf6d'
       
   763  		timeout_seconds='60'>
       
   764  		<method_context>
       
   765  		  <method_credential
       
   766 -		   user='root' group='root'
       
   767 -		   privileges='basic,net_icmpaccess,net_privaddr,net_rawaccess'/>
       
   768 +		   user='root' group='root'/>
       
   769   		</method_context>
       
   770  	</exec_method>
       
   771  
       
   772 @@ -461,10 +608,39 @@
       
   773  		    type='astring' value='core,signal' />
       
   774  	</property_group>
       
   775  
       
   776 +	<!-- Properties in this group are used by routeadm (1M) -->
       
   777 +	<property_group name='routeadm' type='application'>
       
   778 +		<stability value='Unstable' />
       
   779 +		<!-- Identifies service as a routing service -->
       
   780 +		<propval name='daemon' type='astring'
       
   781 +			value='@sbindir@/ospf6d' />
       
   782 +		<propval name='value_authorization' type='astring'
       
   783 +			value='solaris.smf.value.routing' />
       
   784 +		<propval name='protocol' type='astring' value='ipv6'/>
       
   785 +	</property_group>
       
   786 +	
       
   787 +	<!-- Properties in this group are modifiable via routeadm (1M) -->
       
   788  	<property_group name='routing' type='application'>
       
   789  		<propval name='value_authorization' type='astring' 
       
   790 -		         value='solaris.smf.modify.routing' />
       
   791 -		<propval name='daemon-args' type='astring' value='-P 0'/>
       
   792 +		         value='solaris.smf.value.routing' />
       
   793 +
       
   794 +		<!-- Options common to Quagga daemons -->
       
   795 +		<!-- The config file to use, if not the default -->
       
   796 +		<propval name='config_file' type='astring' value=''/>
       
   797 +		<!-- The vty_port to listen on if not the default.
       
   798 +		     0 to disable --> 
       
   799 +		<propval name='vty_port' type='integer' value='0' />
       
   800 +		<!-- The address to bind the VTY interface to, if not any. -->
       
   801 +		<propval name='vty_address' type='astring' value='' />
       
   802 +		<!-- The user to switch to after startup, if not the default -->
       
   803 +		<propval name='user' type='astring' value='' />
       
   804 +		<!-- The group to switch to, if not the default.
       
   805 +		     If user is specified, this defaults to a group with
       
   806 +		     same name as user -->
       
   807 +		<propval name='group' type='astring' value='' />
       
   808 +		<!-- The pidfile to use, if not the default of
       
   809 +		     @quagga_statedir@ -->
       
   810 +		<propval name='pid_file' type='astring' value='' />
       
   811  	</property_group>
       
   812  
       
   813  	<property_group name='general' type='framework'>
       
   814 @@ -471,12 +647,14 @@
       
   815  		<!-- to start stop routing services -->
       
   816  		<propval name='action_authorization' type='astring'
       
   817  			 value='solaris.smf.manage.routing' />
       
   818 +		<propval name='value_authorization' type='astring'
       
   819 +			 value='solaris.smf.manage.routing' />
       
   820  	</property_group>
       
   821  
       
   822  	<template>
       
   823  		<common_name>
       
   824  			<loctext xml:lang='C'>
       
   825 -			Quagga: ospf6d, OSPFv3 IPv6 routing protocol daemon.
       
   826 + 			Quagga: ospf6d, OSPFv3 IPv6 routing protocol daemon.
       
   827  			</loctext>
       
   828  		</common_name>
       
   829  		<documentation>
       
   830 @@ -487,7 +665,7 @@
       
   831  		</documentation>
       
   832  	</template>
       
   833  	</instance>
       
   834 -	<stability value='Evolving' />
       
   835 +	<stability value='Unstable' />
       
   836  </service>
       
   837  
       
   838  
       
   839 @@ -506,40 +684,48 @@
       
   840  			value='svc:/system/filesystem/usr:default' />
       
   841  	</dependency>
       
   842  	
       
   843 -	<!-- Depends on WIP, not yet in SNV
       
   844 -	<dependency name='net'
       
   845 -		grouping='require_any'
       
   846 -		restart_on='none'
       
   847 +	<dependency
       
   848 +		name='ipv6-forwarding'
       
   849 +		grouping='optional_all'
       
   850 +		restart_on='refresh'
       
   851  		type='service'>
       
   852 -		<service_fmri value='svc:/network/routing/ipv6-routing' />
       
   853 -		<service_fmri value='svc:/network/routing/ipv4-routing' />
       
   854 +		<service_fmri value='svc:/network/ipv6-forwarding' />
       
   855  	</dependency>
       
   856 -	-->
       
   857 +
       
   858 +	<dependency
       
   859 +		name='ipv4-forwarding'
       
   860 +		grouping='optional_all'
       
   861 +		restart_on='refresh'
       
   862 +		type='service'>
       
   863 +		<service_fmri value='svc:/network/ipv4-forwarding' />
       
   864 +	</dependency>
       
   865  	
       
   866 -	<dependency name='zebra'
       
   867 -			grouping='optional_all'
       
   868 -			restart_on='restart'
       
   869 -			type='service'>
       
   870 -			<service_fmri value='svc:/network/routing/zebra:quagga' />
       
   871 +	<!-- do not not run unless routing-setup has run -->
       
   872 +	<dependency
       
   873 +		name='network_routing_setup'
       
   874 +		grouping='require_all'
       
   875 +		restart_on='refresh'
       
   876 +		type='service'>
       
   877 +		<service_fmri value='svc:/network/routing-setup' />
       
   878  	</dependency>
       
   879  
       
   880 -	<dependency name='config_data'
       
   881 -		grouping='require_all'
       
   882 +	<!-- ensure that restart of zebra is propogated to daemon -->
       
   883 +	<dependency
       
   884 +		name='zebra'
       
   885 +		grouping='optional_all'
       
   886  		restart_on='restart'
       
   887 -		type='path'>
       
   888 -		<service_fmri
       
   889 -			value='file://localhost/@sysconfdir@/bgpd.conf' />
       
   890 +		type='service'>
       
   891 +		<service_fmri value='svc:/network/routing/zebra:quagga' />
       
   892  	</dependency>
       
   893 -	
       
   894 +
       
   895  	<exec_method
       
   896  		type='method'
       
   897  		name='start'
       
   898 -		exec='/lib/svc/method/quagga bgpd %{routing/daemon-args}'
       
   899 +		exec='/lib/svc/method/quagga bgpd'
       
   900  		timeout_seconds='60'>
       
   901  		<method_context>
       
   902  		  <method_credential
       
   903 -		   user='root' group='root'
       
   904 -		   privileges='basic,net_icmpaccess,net_privaddr,net_rawaccess'/>
       
   905 +		   user='root' group='root'/>
       
   906   		</method_context>
       
   907  	</exec_method>
       
   908  
       
   909 @@ -557,10 +743,55 @@
       
   910  		    type='astring' value='core,signal' />
       
   911  	</property_group>
       
   912  
       
   913 +	<!-- Properties in this group are used by routeadm (1M) -->
       
   914 +	<property_group name='routeadm' type='application'>
       
   915 +		<stability value='Unstable' />
       
   916 +		<!-- Identifies service as a routing service -->
       
   917 +		<propval name='daemon' type='astring'
       
   918 +			value='@sbindir@/bgpd' />
       
   919 +		<propval name='value_authorization' type='astring'
       
   920 +			value='solaris.smf.value.routing' />
       
   921 +		<property name='protocol' type='astring'>
       
   922 +			<astring_list>
       
   923 +				<value_node value='ipv4'/>
       
   924 +				<value_node value='ipv6'/>
       
   925 +			</astring_list>
       
   926 +		</property>
       
   927 +	</property_group>
       
   928 +	
       
   929 +	<!-- Properties in this group are modifiable via routeadm (1M) -->
       
   930  	<property_group name='routing' type='application'>
       
   931  		<propval name='value_authorization' type='astring' 
       
   932 -		         value='solaris.smf.modify.routing' />
       
   933 -		<propval name='daemon-args' type='astring' value='-P 0'/>
       
   934 +		         value='solaris.smf.value.routing' />
       
   935 +
       
   936 +		<!-- Options common to Quagga daemons. -->
       
   937 +		<!-- The config file to use, if not the default -->
       
   938 +		<propval name='config_file' type='astring' value=''/>
       
   939 +		<!-- The vty_port to listen on if not the default.
       
   940 +		     0 to disable --> 
       
   941 +		<propval name='vty_port' type='integer' value='0' />
       
   942 +		<!-- The address to bind the VTY interface to, if not any. -->
       
   943 +		<propval name='vty_address' type='astring' value='' />
       
   944 +		<!-- The user to switch to after startup, if not the default -->
       
   945 +		<propval name='user' type='astring' value='' />
       
   946 +		<!-- The group to switch to, if not the default.
       
   947 +		     If user is specified, this defaults to a group with
       
   948 +		     same name as user -->
       
   949 +		<propval name='group' type='astring' value='' />
       
   950 +		<!-- The pidfile to use, if not the default of
       
   951 +		     @quagga_statedir@ -->
       
   952 +		<propval name='pid_file' type='astring' value='' />
       
   953 +
       
   954 +		<!-- Options specific to bgpd -->
       
   955 +		<propval name='retain' type='boolean' value='false' />
       
   956 +		<propval name='no_kernel' type='boolean' value='false' />
       
   957 +		<propval name='bgp_port' type='astring' value='' />
       
   958 +		
       
   959 +		<!--
       
   960 +			If enable_zebra is false, it will not be switched
       
   961 +			on by the start method.
       
   962 +		-->
       
   963 +		<propval name='enable_zebra' type='boolean' value='true' />
       
   964  	</property_group>
       
   965  
       
   966  	<property_group name='general' type='framework'>
       
   967 @@ -567,6 +798,8 @@
       
   968  		<!-- to start stop routing services -->
       
   969  		<propval name='action_authorization' type='astring'
       
   970  			 value='solaris.smf.manage.routing' />
       
   971 +		<propval name='value_authorization' type='astring'
       
   972 +			 value='solaris.smf.manage.routing' />
       
   973  	</property_group>
       
   974  
       
   975  	<template>
       
   976 @@ -583,6 +816,6 @@
       
   977  		</documentation>
       
   978  	</template>
       
   979  	</instance>
       
   980 -	<stability value='Evolving' />
       
   981 +	<stability value='Unstable' />
       
   982  </service>
       
   983  </service_bundle>