Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Oct 2005 09:10:29 +0400
From:      Yar Tikhiy <yar@comp.chem.msu.su>
To:        freebsd-rc@freebsd.org
Subject:   A fix for `restart'
Message-ID:  <20051026051029.GA32620@comp.chem.msu.su>

next in thread | raw e-mail | index | archive | help
Folks,

Would you mind testing the following patch to /etc/rc.subr
that should remedy problems with `restart', e.g., as found
for /etc/rc.d/jail?  It is safe as it doesn't affect other
commans and hence it won't disrupt your boot sequence :-)
I'm just concerned about possible side-effects for restart
I might have overlooked.  The test case of scripts taking
additional arguments besides the command is the most intriguing.

----- Begin patch -----

--- //depot/user/yar/hack/etc/rc.subr	2005/10/26 04:02:40
+++ //depot/user/yar/hack/etc/rc.subr	2005/10/26 04:57:21
@@ -770,8 +770,9 @@
 			fi
 			_rc_restart_done=true
 
-			( $0 ${_rc_prefix}stop $rc_extra_args )
-			$0 ${_rc_prefix}start $rc_extra_args
+			# 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
 
 			if [ -n "$_postcmd" ]; then
 				eval $_postcmd $rc_extra_args

----- End patch -----

-- 
Yar



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051026051029.GA32620>