From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 1387F13888F for ; Wed, 14 Oct 2015 21:03:32 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8216E21C001; Wed, 14 Oct 2015 21:03:30 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 19D4621C001 for ; Wed, 14 Oct 2015 21:03:30 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2FE91340AC9 for ; Wed, 14 Oct 2015 21:03:29 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id ED26210B1 for ; Wed, 14 Oct 2015 21:03:27 +0000 (UTC) From: "William Hubbs" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" Message-ID: <1444856408.fb23cbe204b9adeb817e2f5be7a1bb827bb9a477.williamh@OpenRC> Subject: [gentoo-commits] proj/openrc:0.18.x commit in: /, init.d/, conf.d/ X-VCS-Repository: proj/openrc X-VCS-Files: NEWS.md conf.d/Makefile conf.d/mtab init.d/mtab.in X-VCS-Directories: / conf.d/ init.d/ X-VCS-Committer: williamh X-VCS-Committer-Name: William Hubbs X-VCS-Revision: fb23cbe204b9adeb817e2f5be7a1bb827bb9a477 X-VCS-Branch: 0.18.x Date: Wed, 14 Oct 2015 21:03:27 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 13723ec2-a5dc-4e95-ace4-3347ea262a2f X-Archives-Hash: 584adfd239e77c1cc29cf498ddb16aac commit: fb23cbe204b9adeb817e2f5be7a1bb827bb9a477 Author: William Hubbs gmail com> AuthorDate: Wed Oct 14 15:41:14 2015 +0000 Commit: William Hubbs gentoo org> CommitDate: Wed Oct 14 21:00:08 2015 +0000 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=fb23cbe2 mtab: make /etc/mtab as a file configurable NEWS.md | 23 +++++++++++++++++++++++ conf.d/Makefile | 2 +- conf.d/mtab | 5 +++++ init.d/mtab.in | 15 ++++++++------- 4 files changed, 37 insertions(+), 8 deletions(-) diff --git a/NEWS.md b/NEWS.md index 819a340..d67ed60 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,6 +3,29 @@ This file will contain a list of notable changes for each release. Note the information in this file is in reverse order. +## OpenRC-0.18.3 + +Modern Linux systems expect /etc/mtab to be a symbolic link to +/proc/self/mounts. Reasons for this change include support for mount +namespaces, which will not work if /etc/mtab is a file. +By default, the mtab service enforces this on each reboot. + +If you find that this breaks your system in some way, please do the +following: + +- Set mtab_is_file=yes in /etc/conf.d/mtab. + +- Restart mtab. This will recreate the /etc/mtab file. + +- Check for an issue on https://github.com/openrc/openrc/issues + explaining why you need /etc/mtab to be a file. If there isn't one, + please open one and explain in detail why you need this to be a file. + If there is one, please add your comments to it. Please give concrete + examples of why it is important that /etc/mtab be a file instead of a + symbolic link. Those comments will be taken into consideration for how + long to keep supporting mtab as a file or when the support can be + removed. + ## OpenRC-0.18 The behaviour of localmount and netmount in this version is changing. In diff --git a/conf.d/Makefile b/conf.d/Makefile index 93476fc..34a3b07 100644 --- a/conf.d/Makefile +++ b/conf.d/Makefile @@ -15,7 +15,7 @@ include ${MK}/os.mk CONF-FreeBSD= ipfw moused powerd rarpd savecore syscons -CONF-Linux= consolefont devfs dmesg hwclock keymaps killprocs modules +CONF-Linux= consolefont devfs dmesg hwclock keymaps killprocs modules mtab CONF-NetBSD= moused rarpd savecore diff --git a/conf.d/mtab b/conf.d/mtab new file mode 100644 index 0000000..9e16d9b --- /dev/null +++ b/conf.d/mtab @@ -0,0 +1,5 @@ +# This setting controls whether /etc/mtab is a file or symbolic link. +# Most of the time, you shouldn't touch this. However, if the default +# breaks your system in some way, please see the NEWS.md file that comes +# with OpenRC for the actions to take. +# mtab_is_file=no diff --git a/init.d/mtab.in b/init.d/mtab.in index 1442ffd..4deaba6 100644 --- a/init.d/mtab.in +++ b/init.d/mtab.in @@ -14,16 +14,17 @@ start() { local rc=0 ebegin "Updating /etc/mtab" - if [ -L /etc/mtab ] ; then - ewarn "/etc/mtab is a symlink, not updating." - ewarn "FYI - You can safely remove mtab from your runlevels." - elif ! checkpath -W /etc; then + if ! checkpath -W /etc; then rc=1 - elif [ ! -e /etc/mtab ]; then - einfo "Creating mtab symlink" + elif ! yesno ${mtab_is_file:-no}; then + [ ! -L /etc/mtab ] && [ -f /etc/mtab] && + ewarn "Removing /etc/mtab file" + einfo "Creating mtab symbolic link" ln -snf /proc/self/mounts /etc/mtab else - einfo "Updating mtab file" + [ -L /etc/mtab ] && ewarn "Removing /etc/mtab symbolic link" + rm -f /etc/mtab + einfo "Creating mtab file" # With / as tmpfs we cannot umount -at tmpfs in localmount as that # makes / readonly and dismounts all tmpfs even if in use which is # not good. Luckily, umount uses /etc/mtab instead of /proc/mounts