From david@releaser.nfrance.com  Tue Jan 19 17:33:39 2010
Return-Path: <david@releaser.nfrance.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0D127106568D
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 19 Jan 2010 17:33:39 +0000 (UTC)
	(envelope-from david@releaser.nfrance.com)
Received: from releaser.nfrance.com (cl-62.mrs-01.fr.sixxs.net [IPv6:2a01:240:fe00:3d::2])
	by mx1.freebsd.org (Postfix) with ESMTP id 7F5B78FC14
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 19 Jan 2010 17:33:37 +0000 (UTC)
Received: from releaser.nfrance.com (localhost [127.0.0.1])
	by releaser.nfrance.com (8.14.3/8.14.3) with ESMTP id o0JHXaah016640;
	Tue, 19 Jan 2010 18:33:36 +0100 (CET)
	(envelope-from david@releaser.nfrance.com)
Received: (from david@localhost)
	by releaser.nfrance.com (8.14.3/8.14.3/Submit) id o0JHXac7016639;
	Tue, 19 Jan 2010 18:33:36 +0100 (CET)
	(envelope-from david)
Message-Id: <201001191733.o0JHXac7016639@releaser.nfrance.com>
Date: Tue, 19 Jan 2010 18:33:36 +0100 (CET)
From: BERARD David <david@nfrance.com>
Reply-To: BERARD David <david@nfrance.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc: laurent@sintes.org
Subject: Strange counter init value in jail rc
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         142973
>Category:       conf
>Synopsis:       [jail] [patch] Strange counter init value in jail rc
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-rc
>State:          analyzed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jan 19 17:40:08 UTC 2010
>Closed-Date:    
>Last-Modified:  Sat Nov 03 12:21:59 UTC 2012
>Originator:     BERARD David
>Release:        FreeBSD 8.0-RELEASE
>Organization:
NFrance Conseil
>Environment:
System: FreeBSD releaser.nfrance.com 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 #0: Mon Jan 18 17:32:06 CET 2010 root@releaser.nfrance.com:/usr/obj/usr/src/sys/LAB i386


>Description:
	_exec_afterstart start to 1 but all other counter start at 0
>How-To-Repeat:
	_exec_afterstart0 isn't executed
>Fix:
	See the attached patch

--- jailrc_afterstart.patch begins here ---
--- /usr/src/etc/rc.d/jail	2009-10-25 02:10:29.000000000 +0100
+++ /usr/src/etc/rc.d/jail	2010-01-19 16:14:43.000000000 +0100
@@ -51,7 +51,7 @@
 
        eval _exec_start=\"\${jail_${_j}_exec_start:-${jail_exec_start}}\"
 
-       i=1
+       i=0
        while : ; do
                eval _exec_afterstart${i}=\"\${jail_${_j}_exec_afterstart${i}:-\${jail_exec_afterstart${i}}}\"
                [ -z "$(eval echo \"\$_exec_afterstart${i}\")" ] &&  break
--- jailrc_afterstart.patch ends here ---


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-rc 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Tue Jan 19 22:34:57 UTC 2010 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=142973 

From: David BERARD <david@nfrance.com>
To: bug-followup@FreeBSD.org, david@nfrance.com
Cc:  
Subject: Re: conf/142973: [jail] [patch] Strange counter init value in jail
 rc
Date: Wed, 20 Jan 2010 09:07:53 +0100

 This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
 --------------enig6BDEF3804FB3D6864A3DB6DE
 Content-Type: text/plain; charset=ISO-8859-1
 Content-Transfer-Encoding: quoted-printable
 
 The example in /etc/defaults/rc.conf is related to afterstart0.
 
 #  grep afterstart /etc/defaults/rc.conf
 #jail_example_exec_afterstart0=3D"/bin/sh command"
 
 
 --=20
 David BERARD
 ---------------------------------------
 NFrance Conseil
 david(at)nfrance.com
 GPG|PGP KeyId 0x7FC68EB8
 GPG|PGP Key http://tinyurl.com/gpgdavid
 ---------------------------------------
 *     No electrons were harmed in     *
 *    the transmission of this email   *
 
 
 --------------enig6BDEF3804FB3D6864A3DB6DE
 Content-Type: application/pgp-signature; name="signature.asc"
 Content-Description: OpenPGP digital signature
 Content-Disposition: attachment; filename="signature.asc"
 
 -----BEGIN PGP SIGNATURE-----
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 
 iEYEARECAAYFAktWud0ACgkQYIAREn/GjrhnpACfb+zf3CE5Gr1V5CYdqvj4/gRW
 lEYAoMNFoydG8i9VyQbJZa2KhUosU8ps
 =tNvc
 -----END PGP SIGNATURE-----
 
 --------------enig6BDEF3804FB3D6864A3DB6DE--
State-Changed-From-To: open->analyzed 
State-Changed-By: crees 
State-Changed-When: Sat Nov 3 12:21:57 UTC 2012 
State-Changed-Why:  
This is a pickle indeed.  Moany people will have used it starting from 
1, since the original code was intended to count from 1; see r159072. 
However, the prestart code added in r191620 counts from 0.  The patch at 
http://www.bayofrum.net/~crees/patches/142973.diff makes it count from 
0, but still work with a warning if the user has started at 1.  I will 
talk to the developers concerned. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=142973 
>Unformatted:
