From owner-freebsd-current@FreeBSD.ORG Thu Sep 4 19:41:56 2014 Return-Path: Delivered-To: freebsd-current@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 22494AEB; Thu, 4 Sep 2014 19:41:56 +0000 (UTC) Received: from mail-la0-x230.google.com (mail-la0-x230.google.com [IPv6:2a00:1450:4010:c03::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C2BC1C09; Thu, 4 Sep 2014 19:41:55 +0000 (UTC) Received: by mail-la0-f48.google.com with SMTP id ty20so925159lab.21 for ; Thu, 04 Sep 2014 12:41:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-type:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=3m7brMSyrWCWth+zLZR3GcYUdWoSoKNXpEAmF8XRZTg=; b=a6cZv3/HYNMr1eFA7QbiuJyGBYj8JebsCCizaIeIBGFcs8lvJklxS9QigUP3bnDCbM rVxfwZAfp7LDbdJrIGJxjDvlXbBO/drDBM5Fbpjokm8bg3bsi+wZmqMdQoEbjo1ESoYd Bk1zNU8eumMWxIR5P0/Caz/G9CHI2+kV2Okbzwv1jhjS/7Fbe2MnTPKS68KPO8qxA9Sr Uce5hUDozbet2PDEWKmfsuaymQlaTSE7ykO886R7IubMmi5UVXM7S0YmOcKn2nMVEHMq qfx8tlTAz1g4WWkgfWakC2ZI2RNQ7KtAw340LhCqGJhh7BQKeSgeXnWWYpvGz/hIl+DU bP6g== X-Received: by 10.152.6.133 with SMTP id b5mr6927017laa.16.1409859712895; Thu, 04 Sep 2014 12:41:52 -0700 (PDT) Received: from pc5.home (abwx83.neoplus.adsl.tpnet.pl. [83.8.247.83]) by mx.google.com with ESMTPSA id w11sm749359lbm.30.2014.09.04.12.41.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 04 Sep 2014 12:41:52 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Thu, 4 Sep 2014 21:41:49 +0200 From: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= To: Hans Ottevanger Subject: Re: [CFT] Autofs. Message-ID: <20140904194149.GA4650@pc5.home> Mail-Followup-To: Hans Ottevanger , freebsd-arch@FreeBSD.org, freebsd-current@FreeBSD.org References: <20140730071933.GA20122@pc5.home> <53F0878E.3000401@beastielabs.net> <20140817145059.GA5497@pc5.home> <5407FFB0.80203@beastielabs.net> <20140904124330.GB4152@pc5.home> <5408760F.2000607@beastielabs.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5408760F.2000607@beastielabs.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-current@FreeBSD.org, freebsd-arch@FreeBSD.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 19:41:56 -0000 On 0904T1624, Hans Ottevanger wrote: > On 09/04/14 14:43, Edward Tomasz Napierała wrote: > >On 0904T0759, Hans Ottevanger wrote: > >>On 08/17/14 16:50, Edward Tomasz Napierała wrote: > >>>On 0817T1244, Hans Ottevanger wrote: > >>>> > >>[...] > >>>>Hi! > >>>> > >>>>Great to see a real autofs finally coming to FreeBSD. > >>>> > >>>>I already did some very cursory testing on a recent 11-CURRENT system > >>>>that I still happened to have and things with at least the /net map > >>>>look quite OK. > >>>> > >>>>I could do some more extensive testing if I could use some of my > >>>>10-STABLE systems. I already checked that the patch applies cleanly > >>>>to a recent 10-STABLE (modulo a few offsets) and that both buildworld > >>>>and buildkernel succeed. Should I expect difficulties actually > >>>>running your autofs on 10-STABLE? > >>> > >>>No, it should be fine. Plan is to MFC this to 10 soon, btw. > >>> > >> > >>Good to see that autofa has been MFC'd during my vacation 8-) > >> > >>But I found a little problem... > >> > >>When I try to access the NFS exported file-systems on an older test > >>machine (running 7.x, but that is not so relevant, it also happens > >>with other servers), with the following exports: > >> > >>$ showmount -e soekris > >>Exports list on soekris: > >>/var 192.168.0.0 > >>/usr 192.168.0.0 > >>/home 192.168.0.0 > >>/ 192.168.0.0 > >> > >>I get: > >> > >>$ ls /net/soekris > >>COPYRIGHT dist libexec proc tmp > >>bin entropy lost+found rescue usr > >>boot etc media root var > >>compat home mnt sbin > >>dev lib > >> > >>which is correct, but the next level fails: > >> > >>$ ls -l /net/soekris/usr > >>total 0 > >> > >>since /usr on soekris is definitely not empty. > >>Relevant output of mount : > >> > >>... > >>map -hosts on /net (autofs) > >>soekris:/ on /net/soekris (nfs, nosuid, automounted) > >> > >>This is on 10.1-PRERELEASE r270922. The kernel config is GENERIC > >>minus devices I do not have and AUTOFS added. Config files > >>(/etc/auto_master, et al) are default. Mounting manually does succeed > >>(in two steps, of course). > >> > >>When trying this from Mac OS X (I am still on Snow Leopard) > >>automounting works as expected. I did not have the opportunity yet to > >>try a Linux box (also do not know whether autofs there has been eaten > >>by systemd already 8-)). > >> > >>Do I miss something, or is this a bug? > > > >It's a bug. Or rather, a missing feature. The problem here is that > >the "/" export "shadows" the rest. To handle this correctly, automountd(8) > >would need to mount the "/" share, then mount autofs on "/usr" etc, and > >then call it done. This part is easy. The problem is: how to expire > >(automatically unmount) it? Because of autofs mounts, the "/" share > >will always be busy, and thus won't ever get automatically unmounted. > >So, for now, we don't even try to handle this situation. > > > >I'm not sure what would the best way to solve it. > > > > Maybe the same way as Mac OS X does. > > On my old MacMini (Snow Leopard) I get in a quiescent state, before > automounting anything: > > /dev/disk0s2 on / (hfs, local, journaled) > devfs on /dev (devfs, local, nobrowse) > map -hosts on /net (autofs, nosuid, automounted, nobrowse) > map auto_home on /home (autofs, automounted, nobrowse) > > Immediately after "ls -l /net/soekris/usr": > > /dev/disk0s2 on / (hfs, local, journaled) > devfs on /dev (devfs, local, nobrowse) > map -hosts on /net (autofs, nosuid, automounted, nobrowse) > map auto_home on /home (autofs, automounted, nobrowse) > soekris:/ on /net/soekris (nfs, nodev, nosuid, automounted, nobrowse) > trigger on /net/soekris/usr (autofs, automounted, nobrowse) > trigger on /net/soekris/var (autofs, automounted, nobrowse) > trigger on /net/soekris/home (autofs, automounted, nobrowse) > soekris:/usr on /net/soekris/usr (nfs, nodev, nosuid, automounted, nobrowse) > > Then, after more than 400 seconds: > > /dev/disk0s2 on / (hfs, local, journaled) > devfs on /dev (devfs, local, nobrowse) > map -hosts on /net (autofs, nosuid, automounted, nobrowse) > map auto_home on /home (autofs, automounted, nobrowse) > soekris:/ on /net/soekris (nfs, nodev, nosuid, automounted, nobrowse) The problem is, in FreeBSD we would never be able to unmount the filesystem above (/net/soekris) due to autofs instances below, which are mounted on top of it: > trigger on /net/soekris/usr (autofs, automounted, nobrowse) > trigger on /net/soekris/var (autofs, automounted, nobrowse) > trigger on /net/soekris/home (autofs, automounted, nobrowse) > > and finally after 600 seconds we are back to: > > /dev/disk0s2 on / (hfs, local, journaled) > devfs on /dev (devfs, local, nobrowse) > map -hosts on /net (autofs, nosuid, automounted, nobrowse) > map auto_home on /home (autofs, automounted, nobrowse) > > So triggers for the subdirectories are automounted on their > automounted parent directory and expiration occurs in steps. BTW, I > reconfigured the automount timeout as 300s (was 3600s) so I do not > fully understand why the first time takes at least 400s. > > If you think it is useful I can grab an older Linux box from my > basement and try to get autofs running on it, to do the same > experiment. I currently do not have a Solaris installation. Nah, not really. I know what the problem is, I'm just not sure what's te best way to approach it. And I really like to fix things the _right_ way. Give me some time :-)