[csw-maintainers] /testing Please help test updated CAS initsmf

Peter Bonivart bonivart at opencsw.org
Thu Apr 21 16:35:45 CEST 2011


On Thu, Apr 21, 2011 at 3:49 PM, Ben Walton <bwalton at opencsw.org> wrote:
> Excerpts from Peter Bonivart's message of Sun Mar 27 10:14:44 -0400 2011:
>
> Hi Peter,
>
>> +    load_smf_service_state "$FMRI/$service"
>
> This function defaults SMF_STATE to enabled.  It can only be toggled
> to disabled if the preserved state file exists.

The state file actually says enabled or disabled so there's no reason
for the function to default to enabled. If the state file exists it
should read the absolute value and if not return neither enabled or
disabled.

load_smf_service_state ()
	{
	    SMF_STATE="enabled"
	
	    if [ -f "$SMF_STATE_FILE" ]; then
	        set -- `/usr/bin/awk " \\\$1 == \"$1\" { print \\\$2 } "
"$SMF_STATE_FILE"`
	        if [ "$1" = "disabled" ]; then
	            SMF_STATE="disabled"
	        fi
	    fi
	}

becomes:

load_smf_service_state ()
	{
	    SMF_STATE=""

	    if [ -f "$SMF_STATE_FILE" ]; then
	        set -- `/usr/bin/awk " \\\$1 == \"$1\" { print \\\$2 } "
"$SMF_STATE_FILE"`
	        if [ "$1" = "disabled" ]; then
	            SMF_STATE="disabled"
	        fi
	        if [ "$1" = "enabled" ]; then
	            SMF_STATE="enabled"
	        fi
	    fi
	}

 That should fix it. Please try that locally and I can update the
package if it works.

/peter


More information about the maintainers mailing list