Browse Source

solaris: Fix quagga.init.in shell errors

* quagga.init.in: SMF_GROUP assignment shell is missing a space, so never works.
  Test for DAEMON_PATH and DAEMON being empty never works,  fix.
  Test for configuration file should use the SMF property, not the default - the
  default config file location is already set in the quagga.xml file that
  sets the SMF property defauls.

  See bugs #877, #878, and #879.

[ commit message by Paul Jakma <paul.jakma@hpe.com> / <paul@jakma.org> ]
Brian Utterback 2 years ago
parent
commit
343074aacf
1 changed files with 9 additions and 5 deletions
  1. 9 5
      solaris/quagga.init.in

+ 9 - 5
solaris/quagga.init.in

@@ -120,7 +120,7 @@ routeadm_daemon_args () {
 	
 	# user and group we need for config file upgrade..
 	SMF_USER=`get_routeadm_property $SMF_FMRI user`
-	SMF_GROUP=`get_routeadm_property()$SMF_FMRI group`
+	SMF_GROUP=`get_routeadm_property() $SMF_FMRI group`
 	if [ "${SMF_USER}" ] ; then
 		USER="${SMF_USER}"
 		args="${args} -u ${SMF_USER}"
@@ -197,7 +197,7 @@ fi
 DAEMON="$1"
 
 # daemon path must be given
-if [ -z "$DAEMON_PATH/$DAEMON" ]; then
+if [ "$DAEMON_PATH/$DAEMON" = "/" ]; then
 	usage
 	exit $SMF_EXIT_ERR_FATAL
 fi
@@ -231,9 +231,13 @@ fi
 
 upgrade_config "$DAEMON"
 
-if [ ! -f "@sysconfdir@/${DAEMON}.conf" ] ; then
-	echo "Could not find config file, @sysconfdir@/${DAEMON}.conf"
-	exit $SMF_EXIT_ERR_CONFIG
+CONF_FILE=`get_routeadm_property $SMF_FMRI config_file`
+if [ -z "$CONF_FILE" ] ; then
+        CONF_FILE="@sysconfdir@/${DAEMON}.conf"
+fi
+if [ ! -f "$CONF_FILE" ] ; then
+        echo "Could not find config file, $CONF_FILE"
+        exit $SMF_EXIT_ERR_CONFIG
 fi
 
 # we need @quagga_statedir@ to exist, it probably is on tmpfs.