Bug 142973 - [jail] [patch] Strange counter init value in jail rc
Summary: [jail] [patch] Strange counter init value in jail rc
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: conf (show other bugs)
Version: 8.0-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: Jamie Gritton
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-19 17:40 UTC by BERARD David
Modified: 2016-01-28 00:42 UTC (History)
2 users (show)

See Also:


Attachments
jailrc_afterstart.patch (453 bytes, patch)
2010-01-19 17:40 UTC, BERARD David
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description BERARD David 2010-01-19 17:40:08 UTC
	_exec_afterstart start to 1 but all other counter start at 0

Fix: See the attached patch
How-To-Repeat: 	_exec_afterstart0 isn't executed
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2010-01-19 22:34:57 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-rc

Over to maintainer(s).
Comment 2 BERARD David 2010-01-20 08:07:53 UTC
The example in /etc/defaults/rc.conf is related to afterstart0.

#  grep afterstart /etc/defaults/rc.conf
#jail_example_exec_afterstart0="/bin/sh command"


-- 
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   *
Comment 3 Chris Rees freebsd_committer freebsd_triage 2012-11-03 12:21:57 UTC
State Changed
From-To: open->analyzed

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.
Comment 4 Jamie Gritton freebsd_committer freebsd_triage 2016-01-25 22:11:35 UTC
I am committing a different patch, since the underlying rc file has changed.  I've dispensed with the warning since there's already a warning against using rc-conf-based jail parameters.
Comment 5 commit-hook freebsd_committer freebsd_triage 2016-01-25 22:14:55 UTC
A commit references this bug:

Author: jamie
Date: Mon Jan 25 22:14:31 UTC 2016
New revision: 294749
URL: https://svnweb.freebsd.org/changeset/base/294749

Log:
  Allow the (old rc-style) exec_afterstart jail parameters to start numbering
  at 0, like exec_prestart and the others do.  Make param0 optional, i.e.
  still look for param1.

  PR:		142973
  MFC after:	3 days

Changes:
  head/etc/rc.d/jail
Comment 6 commit-hook freebsd_committer freebsd_triage 2016-01-28 00:41:33 UTC
A commit references this bug:

Author: jamie
Date: Thu Jan 28 00:41:07 UTC 2016
New revision: 294964
URL: https://svnweb.freebsd.org/changeset/base/294964

Log:
  MFC r294749:

    Allow the (old rc-style) exec_afterstart jail parameters to start numbering
    at 0, like exec_prestart and the others do.  Make param0 optional, i.e.
    still look for param1.

  PR:		142973

Changes:
_U  stable/10/
  stable/10/etc/rc.d/jail