aboutsummaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorYaroslav Tykhiy <ytykhiy@gmail.com>2005-11-16 10:45:19 +0000
committerYaroslav Tykhiy <ytykhiy@gmail.com>2005-11-16 10:45:19 +0000
commitfd9791c1ea0496918f25535f1f90ffe9ba32b106 (patch)
tree92364a2c1c1125914525b242b7ad543631800e1b /etc
parentb77640621bd5ac57b56ec983e86e5309eb4c9f5c (diff)
downloadsrc-fd9791c1ea0496918f25535f1f90ffe9ba32b106.tar.gz
src-fd9791c1ea0496918f25535f1f90ffe9ba32b106.zip
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
Notes
Notes: svn path=/head/; revision=152519
Diffstat (limited to 'etc')
-rw-r--r--etc/rc.subr5
1 files changed, 3 insertions, 2 deletions
diff --git a/etc/rc.subr b/etc/rc.subr
index 4ed122a2e197..ff88433c5e58 100644
--- a/etc/rc.subr
+++ b/etc/rc.subr
@@ -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