From owner-freebsd-bugs@FreeBSD.ORG Sat Jun 22 02:10:02 2013 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 260479A9 for ; Sat, 22 Jun 2013 02:10:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 065391631 for ; Sat, 22 Jun 2013 02:10:02 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r5M2A1LW079900 for ; Sat, 22 Jun 2013 02:10:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r5M2A1Qv079899; Sat, 22 Jun 2013 02:10:01 GMT (envelope-from gnats) Resent-Date: Sat, 22 Jun 2013 02:10:01 GMT Resent-Message-Id: <201306220210.r5M2A1Qv079899@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, John Marshall Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 781D3997 for ; Sat, 22 Jun 2013 02:06:53 +0000 (UTC) (envelope-from john.marshall@riverwillow.com.au) Received: from mail1.riverwillow.net.au (mail1.riverwillow.net.au [203.58.93.36]) by mx1.freebsd.org (Postfix) with ESMTP id DA0981628 for ; Sat, 22 Jun 2013 02:06:52 +0000 (UTC) Received: from rwpc15.mby.riverwillow.net.au (rwpc15.mby.riverwillow.net.au [172.25.24.201]) (authenticated bits=0) by mail1.riverwillow.net.au (8.14.7/8.14.7) with ESMTP id r5M1pcw9012071 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 22 Jun 2013 11:51:38 +1000 (AEST) Received: from rwpc15.mby.riverwillow.net.au (john@localhost [127.0.0.1]) by rwpc15.mby.riverwillow.net.au (8.14.5/8.14.5) with ESMTP id r5M1pbDB028103 for ; Sat, 22 Jun 2013 11:51:37 +1000 (AEST) (envelope-from john.marshall@riverwillow.com.au) Received: (from john@localhost) by rwpc15.mby.riverwillow.net.au (8.14.5/8.14.5/Submit) id r5M1pbT4028102; Sat, 22 Jun 2013 11:51:37 +1000 (AEST) (envelope-from john) Message-Id: <201306220151.r5M1pbT4028102@rwpc15.mby.riverwillow.net.au> Date: Sat, 22 Jun 2013 11:51:37 +1000 (AEST) From: John Marshall To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: conf/179828: [PATCH] rc.d/syslogd link socket to /dev/log fails in jails X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: John Marshall List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jun 2013 02:10:02 -0000 >Number: 179828 >Category: conf >Synopsis: [PATCH] rc.d/syslogd link socket to /dev/log fails in jails >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sat Jun 22 02:10:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: John Marshall >Release: FreeBSD 9.1-RELEASE-p4 i386 >Organization: Riverwillow Pty Ltd >Environment: System: FreeBSD rwpc15 9.1-RELEASE-p4 FreeBSD 9.1-RELEASE-p4 #0 r251961: Wed Jun 19 18:10:39 AEST 2013 root@rwpc15:/usr/obj/build/src/sys/RWPC15 i386 >Description: 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. >How-To-Repeat: - Create a jail(8) - /etc/rc.d/syslogd start (from within the 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")? Index: etc/rc.d/syslogd =================================================================== --- etc/rc.d/syslogd (revision 251961) +++ etc/rc.d/syslogd (working copy) @@ -25,9 +25,9 @@ { local _l _ldir - # Transitional symlink for old binaries + # Transitional symlink for old binaries (not possible in jails) # - if [ ! -L /dev/log ]; then + if [ ! -L /dev/log -a `$SYSCTL_N security.jail.jailed` -eq 0 ]; then ln -sf /var/run/log /dev/log fi rm -f /var/run/log --- syslogd.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: