From owner-freebsd-rc@FreeBSD.ORG Fri Oct 19 08:47:28 2007 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B176016A46D for ; Fri, 19 Oct 2007 08:47:28 +0000 (UTC) (envelope-from mtm@FreeBSD.Org) Received: from terra.mike.lan (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 1516313C45B; Fri, 19 Oct 2007 08:47:27 +0000 (UTC) (envelope-from mtm@FreeBSD.Org) Received: by terra.mike.lan (Postfix, from userid 1000) id 9A03A6780D; Fri, 19 Oct 2007 11:51:54 +0300 (EAT) Date: Fri, 19 Oct 2007 11:51:54 +0300 From: Mike Makonnen To: John E Hein Message-ID: <20071019085154.GA3185@terra.mike.lan> References: <18199.34219.154950.645190@gromit.timing.com> <18199.44324.813707.124793@gromit.timing.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="17pEHd4RhPHOinZp" Content-Disposition: inline In-Reply-To: <18199.44324.813707.124793@gromit.timing.com> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD/7.0-CURRENT (i386) Cc: freebsd-rc@freebsd.org Subject: Re: rc.subr, 1.34.2.22, breaks amd_map_program="ypcat -k amd.master" in RELENG_6 X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2007 08:47:28 -0000 --17pEHd4RhPHOinZp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Oct 18, 2007 at 12:59:48PM -0600, John E Hein wrote: > > The last diff blob above is the trouble maker. > The new run_rc_doit() function does this: > > + eval "$@" > > If you remove the quotes, it starts working again. > > Unfortunately, you can have different problems if you don't quote $@ > (for instance, args with spaces become two args). I don't know if > yar@ added that to address a specific issue or just to be more > future-proof in terms of quoting. But it breaks if the command > or args have a newline. > > Maybe it's best to just do the echo in /etc/rc.d/amd that I showed in > the previous email and document that $rc_flags and $command, etc., should > not have newlines. Here's that patch again: I agree. I think that modifying rc.d/amd is the proper solution here. It's probably a bug that it depends on run_rc_command()'s internal behaviour. Can you try the following slightly different patch? Cheers. -- Mike Makonnen | GPG-KEY: http://people.freebsd.org/~mtm/mtm.asc mmakonnen @ gmail.com | AC7B 5672 2D11 F4D0 EBF8 5279 5359 2B82 7CD4 1F55 mtm @ FreeBSD.Org | FreeBSD - http://www.freebsd.org --17pEHd4RhPHOinZp Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=rcd-amd-patch Index: etc/rc.d/amd =================================================================== RCS file: /home/ncvs/src/etc/rc.d/amd,v retrieving revision 1.18 diff -u -r1.18 amd --- etc/rc.d/amd 18 Oct 2006 15:56:11 -0000 1.18 +++ etc/rc.d/amd 19 Oct 2007 08:35:36 -0000 @@ -34,7 +34,7 @@ [Nn][Oo] | '') ;; *) - rc_flags="${rc_flags} `eval ${amd_map_program}`" + rc_flags="${rc_flags} `echo $(eval ${amd_map_program})`" ;; esac @@ -46,7 +46,8 @@ fi ;; *) - rc_flags="-p ${rc_flags} > /var/run/amd.pid 2> /dev/null" + rc_flags="-p ${rc_flags}" + command_args=" > /var/run/amd.pid 2> /dev/null" ;; esac return 0 --17pEHd4RhPHOinZp--