Date: Fri, 09 Jun 2006 05:03:37 +0200 From: Rick van der Zwet <rick@wzoeterwoude.net> To: FreeBSD-gnats-submit@FreeBSD.org Cc: rick@wzoeterwoude.net Subject: misc/98734: [Patch] /etc/rc.subr restart_postcmd is failing start_postcmd executed instead Message-ID: <4488E509.4020606@wzoeterwoude.net> Resent-Message-ID: <200606090310.k593APCK089965@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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@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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4488E509.4020606>