misc/98734: [Patch] /etc/rc.subr restart_postcmd is failing start_postcmd executed instead

Rick van der Zwet rick at wzoeterwoude.net
Fri Jun 9 03:10:37 UTC 2006


>Number:         98734
>Category:       misc
>Synopsis:       [Patch] /etc/rc.subr restart_postcmd is failing start_postcmd executed instead
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jun 09 03:10:24 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Rick van der Zwet
>Release:        FreeBSD 6.1-STABLE i386
>Organization:
Stichting Wireless Leiden
>Environment:
System: FreeBSD freezone-mobile 6.1-STABLE FreeBSD 6.1-STABLE #8: Wed 
Jun 7 00:37:44 CEST 2006 
root at freezone-mobile:/usr/obj/usr/src/sys/SONY_VAIO i386


	
>Description:
     instead of excecuting restart_postcmd it issues start_postcmd again
>How-To-Repeat:
create foe.sh
. /etc/rc.subr
name='foe'
foe_enable="yes"
rcvar=`set_rcvar`
start_postcmd="echo 'foo'"
restart_postcmd="echo 'bar'"
run_rc_command "$1"

execute  sh foe.sh restart, output will be
foo
foo
>Fix:

	

--- rc.subr.diff begins here ---
--- rc.subr.orig	Fri Jun  9 04:50:16 2006
+++ rc.subr	Fri Jun  9 04:50:36 2006
@@ -776,7 +776,7 @@

  			# run stop in a subshell to keep variables for start
  			( run_rc_command ${_rc_prefix}stop $rc_extra_args )
-			run_rc_command ${_rc_prefix}start $rc_extra_args
+			( run_rc_command ${_rc_prefix}start $rc_extra_args )

  			if [ -n "$_postcmd" ]; then
  				eval $_postcmd $rc_extra_args
--- rc.subr.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list