From owner-freebsd-rc@FreeBSD.ORG Mon Dec 2 13:37:02 2013 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ACD42223 for ; Mon, 2 Dec 2013 13:37:02 +0000 (UTC) Received: from services.syscare.sk (services.syscare.sk [188.40.39.36]) by mx1.freebsd.org (Postfix) with ESMTP id 69CE013B6 for ; Mon, 2 Dec 2013 13:37:02 +0000 (UTC) Received: from services.syscare.sk (services.syscare.sk [188.40.39.36]) by services.syscare.sk (Postfix) with ESMTP id B5849C6B7; Mon, 2 Dec 2013 14:36:54 +0100 (CET) X-Virus-Scanned: amavisd-new at rulez.sk Received: from services.syscare.sk ([188.40.39.36]) by services.syscare.sk (services.rulez.sk [188.40.39.36]) (amavisd-new, port 10024) with ESMTP id gVaxeAKp1-1Q; Mon, 2 Dec 2013 14:36:52 +0100 (CET) Received: from hosting.syscare.sk (hosting [188.40.39.37]) by services.syscare.sk (Postfix) with ESMTP id 57709C6AF; Mon, 2 Dec 2013 14:36:52 +0100 (CET) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 02 Dec 2013 14:36:52 +0100 From: Daniel Gerzo To: Matthew Seaman Subject: Re: devfs and late file systems Organization: The FreeBSD Project In-Reply-To: <529BA665.7040703@infracaninophile.co.uk> References: <52900DA8.3090102@FreeBSD.org> <529BA665.7040703@infracaninophile.co.uk> Message-ID: X-Sender: danger@FreeBSD.org User-Agent: Roundcube Webmail/0.7.2 Cc: freebsd-rc@freebsd.org X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Dec 2013 13:37:02 -0000 On 2013-12-01 22:13, Matthew Seaman wrote: > On 23/11/2013 02:06, Daniel Gerzo wrote: >> Hello, >> >> I am using a root on zfs setup with mounts handled by zfs itself (i.e. >> not legacy mountpoints through fstab). Furthermore I am using service >> jails to separate things. I am running named in one of such jails. >> Obviously I need devfs, and therefore I have added this to my fstab: >> >> devfs /jails/named/var/named/dev devfs rw,late 0 0 >> >> I had to add the late keyword to fstab because without it the system >> wouldn't boot because fstab mounts (mountcritlocal rc.d script) are >> handled just before zfs and as such the system wouldn't have such path >> available yet. >> >> Moreover, named needs only a few dev entries and as such I wanted to >> apply my devfs ruleset, so I added this to rc.conf: >> >> devfs_set_rulesets="/jails/named/var/named/dev=devfsrules_named" >> >> However, this fails during system startup because when the devfs rc.d >> script is run, the filesystems marked as late are not mounted yet. >> >> There are two obvious options to fix this issue: >> - we can either move zfs before mountcritlocal which would also fix >> this >> issue with having to use the late filesystems in fstab, or >> - we can move mountlate before devfs. >> >> I guess the second option is safer (just add mountlate to REQUIRE: >> line >> of devfs) but I may be missing something. Can someone fix this in src, >> or should I? >> >> Thank you! >> >> PS: I am not subscribed to this list so please keep me cc:ed >> > > Assming your jail is tagged as 'named' in rc.conf, create a file > /etc/fstab.named with your devfs mount details in there. Then add > > jail_mount_enable="YES" (applies to all jails) > > or > > jail_named_mount_enable="YES" (just for that jail) > > /etc/rc.d/jail will mount the contents of /etc/fstab.named at jail This is actually a way to avoid the late keyword from the fstab, however this doesn't seem to solve the issue of applying the devfs rules from rc.conf. > startup time, which is well after all the zfs mounts have happened. From my quick inspection of the scripts and rcorder it seems like the devfs script which applies the devfs rules is run quite soon (before mountlate) and thus when I start my jails the devfs script is not going to be run again and thus my rules won't apply. Note that named is chrooted in the jail and needs the devfs in /var/named/dev and therefore I can't use the standard jail_example_devfs_enable="NO" jail_example_devfs_ruleset="ruleset_name" Or am I missing somethnig? -- Kind regards Daniel