Bug 208806 - [jail] starting a jail more than once results in the ID file being blown away
Summary: [jail] starting a jail more than once results in the ID file being blown away
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 10.2-RELEASE
Hardware: Any Any
: --- Affects Only Me
Assignee: Jamie Gritton
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-14 19:30 UTC by Tom Judge
Modified: 2016-04-28 01:37 UTC (History)
1 user (show)

See Also:


Attachments
Stop removing jail.id files when startup fails (581 bytes, patch)
2016-04-23 00:44 UTC, Jamie Gritton
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Judge freebsd_committer freebsd_triage 2016-04-14 19:30:43 UTC
Trying to start the same jail more than once results in the .id file being blown away
i.e. /var/run/jail_name.id


Causes problems with ezjail-admin list being unable to report the status if a jail is mistakenly started more than once.
Comment 1 Jamie Gritton freebsd_committer freebsd_triage 2016-04-23 00:44:33 UTC
Created attachment 169586 [details]
Stop removing jail.id files when startup fails

The diff is quite simple: rc.d/jail used to create the file when a jail started, but after the change to use config files, that was expanded to also remove the file when startup failed.  The fix is simply not to do that.
Comment 2 commit-hook freebsd_committer freebsd_triage 2016-04-23 16:23:13 UTC
A commit references this bug:

Author: jamie
Date: Sat Apr 23 16:23:01 UTC 2016
New revision: 298516
URL: https://svnweb.freebsd.org/changeset/base/298516

Log:
  Don't remove the /var/run/jail_name.id file if a jail fails to start.
  This messes up ezjail (and possibly others), when attempting to start
  a jail that already exists.

  PR:		208806
  Reviewed by:	tj
  MFC after:	5 days

Changes:
  head/etc/rc.d/jail
Comment 3 commit-hook freebsd_committer freebsd_triage 2016-04-28 01:31:21 UTC
A commit references this bug:

Author: jamie
Date: Thu Apr 28 01:31:07 UTC 2016
New revision: 298728
URL: https://svnweb.freebsd.org/changeset/base/298728

Log:
  MFC r298516:

    Don't remove the /var/run/jail_name.id file if a jail fails to start.
    This messes up ezjail (and possibly others), when attempting to start
    a jail that already exists.

  PR:		208806
  Reviewed by:	tj

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