Bug 179828 - [rc.d] [PATCH] rc.d/syslogd link socket to /dev/log fails in jails
Summary: [rc.d] [PATCH] rc.d/syslogd link socket to /dev/log fails in jails
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: conf (show other bugs)
Version: 9.1-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: Hiroki Sato
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-22 03:10 UTC by John Marshall
Modified: 2016-10-22 00:53 UTC (History)
2 users (show)

See Also:
bugmeister: mfc-stable10?
bugmeister: mfc-stable9?
bugmeister: mfc-stable8?


Attachments
file.diff (507 bytes, patch)
2013-06-22 03:10 UTC, John Marshall
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Marshall 2013-06-22 03:10:00 UTC
syslogd startup in a jail always displays the following messages:

  ln: /dev/log: Operation not permitted
  Starting syslogd.

The final paragraph of syslogd(8) states:

  "The log socket was moved from /dev to ease the use of a read-only
   root file system.  This may confuse some old binaries so that a
   symbolic link might be used for a transitional period."

The suggested symbolic link is created by etc/rc.d/syslogd at startup if
there is no /dev/log link already in place.  Creation of the symbolic
link is not possible in a jail.  ln(1) emits the failure message when
link creation is attempted within a jail.

Fix: The attached patch to etc/rc.d/syslogd tests to make sure that we are
*not* in a jail prior to attempting creation of the /dev/log link to the
syslogd log socket.

BUT...

Given that creation of this link was intended to be for a TRANSITIONAL
period, and that it has existed for ever (well, ever since importing the
rc.d scripts (r78344) from NetBSD in 2001) perhaps it might be time to
retire this link creation altogether or, at least, make it optional via
rc.conf (syslogd_link_devlog="NO")?

How-To-Repeat: 
 - Create a jail(8)
 - /etc/rc.d/syslogd start (from within the jail)
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2013-06-22 04:33:05 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-rc

Over to maintainer(s).
Comment 2 John Marshall 2014-09-11 20:59:55 UTC
syslogd startup in a jail always displays the following messages:

  ln: /dev/log: Operation not permitted
  Starting syslogd.

- This bug report includes a patch and other suggestions to avoid that error
- This bug report is now nearly 15 months old

Any takers?
Comment 3 Hiroki Sato freebsd_committer freebsd_triage 2014-10-01 20:32:59 UTC
Take.
Comment 4 commit-hook freebsd_committer freebsd_triage 2014-11-03 00:38:24 UTC
A commit references this bug:

Author: hrs
Date: Mon Nov  3 00:37:40 UTC 2014
New revision: 273999
URL: https://svnweb.freebsd.org/changeset/base/273999

Log:
  Do not try to create a /dev/log symlink in a jail.

  PR:	179828

Changes:
  head/etc/rc.d/syslogd
Comment 5 Hiroki Sato freebsd_committer freebsd_triage 2014-11-03 00:43:32 UTC
Committed an equivalent patch.  This will be MFCed.
Comment 6 fullermd 2015-02-14 12:06:10 UTC
I just noticed this on a stable/10 jail.  Any reason not to MFC?
Comment 7 commit-hook freebsd_committer freebsd_triage 2015-02-14 18:57:29 UTC
A commit references this bug:

Author: hrs
Date: Sat Feb 14 18:56:44 UTC 2015
New revision: 278771
URL: https://svnweb.freebsd.org/changeset/base/278771

Log:
  MFC r273999:

  Do not try to create a /dev/log symlink in a jail.

  PR:	179828

Changes:
_U  stable/10/
  stable/10/etc/rc.d/syslogd
Comment 8 commit-hook freebsd_committer freebsd_triage 2015-02-14 18:57:31 UTC
A commit references this bug:

Author: hrs
Date: Sat Feb 14 18:57:04 UTC 2015
New revision: 278772
URL: https://svnweb.freebsd.org/changeset/base/278772

Log:
  MFC r273999 and r271545:

  Do not try to create a /dev/log symlink in a jail.

  PR:	179828

Changes:
_U  stable/9/etc/
_U  stable/9/etc/rc.d/
  stable/9/etc/rc.d/syslogd
  stable/9/etc/rc.subr
Comment 9 Hiroki Sato freebsd_committer freebsd_triage 2015-02-14 18:59:17 UTC
This change has been merged into stable/9 and stable/10.  Thank you for your report.
Comment 10 Spag 2016-10-22 00:53:55 UTC
After upgrade to FreeBSD11.0-p1 problem come back.