From owner-freebsd-rc@FreeBSD.ORG Thu Oct 18 16:26:44 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 4D4FD16A41A for ; Thu, 18 Oct 2007 16:26:44 +0000 (UTC) (envelope-from jhein@timing.com) Received: from Daffy.timing.com (mx2.timing.com [206.168.13.218]) by mx1.freebsd.org (Postfix) with ESMTP id 0361213C467 for ; Thu, 18 Oct 2007 16:26:43 +0000 (UTC) (envelope-from jhein@timing.com) Received: from gromit.timing.com (gromit.timing.com [206.168.13.209]) by Daffy.timing.com (8.13.1/8.13.1) with ESMTP id l9IGBSdI084828 for ; Thu, 18 Oct 2007 10:11:28 -0600 (MDT) (envelope-from jhein@timing.com) Received: from gromit.timing.com (localhost [127.0.0.1]) by gromit.timing.com (8.14.1/8.14.1) with ESMTP id l9IGBNpv044411; Thu, 18 Oct 2007 10:11:23 -0600 (MDT) (envelope-from jhein@gromit.timing.com) Received: (from jhein@localhost) by gromit.timing.com (8.14.1/8.14.1/Submit) id l9IGBNnf044408; Thu, 18 Oct 2007 10:11:23 -0600 (MDT) (envelope-from jhein) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18199.34219.154950.645190@gromit.timing.com> Date: Thu, 18 Oct 2007 10:11:23 -0600 From: John E Hein To: freebsd-rc@freebsd.org X-Mailer: VM 7.19 under Emacs 22.0.99.1 X-Virus-Scanned: ClamAV version 0.91.2, clamav-milter version 0.91.2 on Daffy.timing.com X-Virus-Status: Clean Subject: 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: Thu, 18 Oct 2007 16:26:44 -0000 I use amd with nis. My rc.conf settings are: amd_enable=YES amd_map_program="ypcat -k amd.master" Output of ypcat -k amd.master looks like so: /foo amd.foo /bar amd.bar /baz amd.baz I was running RELENG_6 from early July. But I just updated to yesterday's RELENG_6. Now upon running /etc/rc.d/amd start, I get: eval: /bar: Permission denied eval: /baz: Permission denied And the /var/run/amd.pid is empty (explained below). The reason is that the rc_flags has line breaks in it and the new rc.subr no longer converts them to spaces. If you put set | grep -A 10 rc_flags in /etc/rc.d/amd after this line: rc_flags="${rc_flags} `eval ${amd_map_program}`" ... you will see something like this: rc_flags='-a /.amd_mnt -l syslog /host /etc/amd.map /net /etc/amd.map /foo amd.foo /bar amd.bar /baz amd.baz' Later the -p ${rc_flags} > /var/run/amd.pid 2> /dev/null is tacked on, putting "> ..." it's own separate line. This explains why /var/run/amd.pid is empty. When using 1.34.2.22 (MFC of 1.72, 2007/08/17, committed by yar from conf/98734), it fails with the described behavior. Using 1.34.2.21 (2007/07/12), it works fine. Something in the .22 commit causes the newlines to not get converted to plain spaces. I have not yet attempted to narrow down what in .22 (+198 -146) actually changes the behavior, but the following works around the problem by converting the newlines to spaces: Index: amd =================================================================== RCS file: /base/FreeBSD-CVS/src/etc/rc.d/amd,v retrieving revision 1.15.2.3 diff -u -p -r1.15.2.3 amd --- amd 22 Oct 2006 20:33:10 -0000 1.15.2.3 +++ amd 18 Oct 2007 15:57:34 -0000 @@ -34,7 +34,7 @@ amd_precmd() [Nn][Oo] | '') ;; *) - rc_flags="${rc_flags} `eval ${amd_map_program}`" + rc_flags="${rc_flags} `echo $(eval ${amd_map_program})`" ;; esac