Avoid invoking the current script again when we need
to issue sub-commands, e.g., restart = stop + start. By calling run_rc_command instead, we provide rc.d scripts with full control over their configuration variables. For an example problem the former approach caused, see http://lists.freebsd.org/pipermail/freebsd-rc/2005-October/000311.html Reviewed by: freebsd-rc Tested by: Dirk Engling erdgeist <at> erdgeist.org MFC after: 2 weeks
This commit is contained in:
parent
b77640621b
commit
fd9791c1ea
@ -770,8 +770,9 @@ $command $rc_flags $command_args"
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user