From owner-freebsd-stable@freebsd.org Wed Jan 8 21:09:27 2020 Return-Path: Delivered-To: freebsd-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AF8FA1FB07A for ; Wed, 8 Jan 2020 21:09:27 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47tMLt1qQLz48wc for ; Wed, 8 Jan 2020 21:09:25 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm1-x335.google.com with SMTP id a5so478769wmb.0 for ; Wed, 08 Jan 2020 13:09:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to; bh=627fCrDjMJ/BwSvWSo9mEWhhCQ7wiO9xJKMKvds4bpI=; b=c01dyuSyXL+lFKo3Oo1BZoh70sv9RWqNBNN2fONbTyMT/wSqcXFOkdOyyImyyq5TFS AV+Z0Yx4rP6TU/Or7c00B6v4H0H8ntyFCrgb3c3BLz91FXYzOOiDbvT/b9N3bpGakpXq 3B0BZLMYS1H1tXuXC8f4dJnqBV2pzZSNsi8G2IOcUoBvV2/lyrMfoxnWEk0cMrMkhwqs jbSm9yUJfKBbG5gWzh0cQ5raZUTmUMFtPQ7j2NqSbm3vtDDmX6LZApGqq1XzukdRyyND Uo+XuihtusuRXp6R4TCj6SCrv6NesEsG86G9GQSDzQU89EOkzApXmD4G+YQedAma1CPN e9cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=627fCrDjMJ/BwSvWSo9mEWhhCQ7wiO9xJKMKvds4bpI=; b=KyQ57d35A+gFBUCwmqTevzEiWVPSKn010G8ETXS/9YqMmaLjMY9K6YwRLTW5NTMPsN /zZqJN71c7QpyYkB8Dtj80B5kahIeVJ4I81znAvxM5Fg9fFHGz+woqoBx+9zqqZv0eAE 9Oq9DI5ps7pIyvqMGcWZnj7awC5z3fQB4UwQ2ZmEecPnNyzK6pBDfUkQbWJ8IRd/DmAs 9FI+j1c+QD+K72uL61u4Xbiu7HqEoBE0TOGBJMrZtJYRtusV5gtlufwnWeTNtbv9RsAN Z+oPhJySl4Nw4a/y7MI6eC9mRkJZXhuiREto+Dn/xB13+8ErdQi5W5GNpawjTg4v32fX RyBQ== X-Gm-Message-State: APjAAAVu+RxzIyr79nULaLlexjZViFKLaN/4Z06Fag/JjdjZavrxd+C/ MeiRlxjUdJkuPGp1P1OsVLxrJFIlrFY= X-Google-Smtp-Source: APXvYqy2K+DcrvlK+85oGjVxsimM9jEfuYJXST1+OBRXCl4glA6RnZtvW4JBHoCMrcH3eOqOsQo11g== X-Received: by 2002:a1c:66d5:: with SMTP id a204mr644867wmc.64.1578517764228; Wed, 08 Jan 2020 13:09:24 -0800 (PST) Received: from brick (cpc92302-cmbg19-2-0-cust461.5-4.cable.virginm.net. [82.1.209.206]) by smtp.gmail.com with ESMTPSA id l17sm5392058wro.77.2020.01.08.13.09.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2020 13:09:23 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Wed, 8 Jan 2020 21:09:21 +0000 From: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= To: Lee Damon Cc: freebsd-stable@freebsd.org Subject: Re: two questions about autofs on FBSD Message-ID: <20200108210921.GA40959@brick> Mail-Followup-To: Lee Damon , freebsd-stable@freebsd.org References: <578798e4-5e26-6116-9ffe-6dcc4f08ed59@castle.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <578798e4-5e26-6116-9ffe-6dcc4f08ed59@castle.org> X-Rspamd-Queue-Id: 47tMLt1qQLz48wc X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=c01dyuSy; dmarc=none; spf=pass (mx1.freebsd.org: domain of etnapierala@gmail.com designates 2a00:1450:4864:20::335 as permitted sender) smtp.mailfrom=etnapierala@gmail.com X-Spamd-Result: default: False [-4.43 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-stable@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; RCVD_COUNT_THREE(0.00)[3]; MIME_TRACE(0.00)[0:+]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[5.3.3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; IP_SCORE(-2.73)[ip: (-9.13), ipnet: 2a00:1450::/32(-2.61), asn: 15169(-1.85), country: US(-0.05)]; FORGED_SENDER(0.30)[trasz@freebsd.org,etnapierala@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[206.209.1.82.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[trasz@freebsd.org,etnapierala@gmail.com]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jan 2020 21:09:27 -0000 On 0103T1602, Lee Damon wrote: > I am (reluctantly) replacing am-utils (amd) with autofs. To do this I > need to replace a lot of functionality that I've had embedded for a very > long time and which my users absolutely rely on. I have two (so far) > questions that I need to solve before I can proceed with this process. > > Question 1 - One of those features is the ability to use a symlink > instead of a NFS mount. For a simplistic example: > > /homes/accountname -> /net/server/home/accountname > > On Linux this is a : entry in /etc/auto.homes: > accountname :/net/server/home/accountname > > but when I test it on FBSD 11-3 I get: > automountd[1784]: "mount -t nfs -o automounted,retrycnt=1 > /net/[redacted]/vol/home/[redacted] /homes/[redacted]/", pid 1785, > terminated with exit status 1 > > Which sure looks like it is trying to NFS mount the local filesystem, > which clearly won't work. > > I use this functionality all over the place including linking into AFS > space and making smart decisions of which subdirectory to present, so I > can't just turn all of the links into NFS mounts. > > I found a bug report against the 10.1 version of autofs asking for the > linking functionality but it was closed with no comment. I'm not finding > any other documentation that references how to do a link. I'm afraid linking isn't supported. I've always considered it an optimization that made sense back when NFS could have significant overhead and nowadays just wasn't worth it. One thing you could try is to use nullfs(5) instead of NFS for this specific case. I no longer remember all the details, but simply adding '-t nullfs' to the map entry above should work. > The media mount seems to be done via a special script instead of just a > link. So, I have to ask, is this something that can be done? How do I do it? Media mounts are handled by executable maps, aka special maps; there's nothing media-specific in autofs itself, apart from the /etc/autofs/special_media shell script. Now that you mention it, there is a /etc/autofs/include_nis_nullfs special map which does the nullfs symlink, although it's to be used with NIS. Might be useful if adding "-t nullfs" in a static map file isn't enough. > Question 2 - How do I get automount to reload a map if a filesystem is > already mounted? It looks like issuing the "automount" command with no > flags should get it to reload maps but it seems to be ignoring any > changes to a map if that map has anything active. > > 99% of my map updates are to add a new filesystem to an existing map and > I need all of the hosts to pick up the changes the next time CM runs. On > Linux "systemctl reload autofs" does it but "service automount reload" > doesn't exist, and as I said, "automount" ignores map changes for active > maps. I'm _certain_ I'm missing something simple and obvious here, I > can't believe there's no way to reload an active map. > > Any information related to either question is much appreciated. Executing "automount" will refresh top-level mounts (ie all the filesystems of type "autofs"); running "automount -c" will flush cached maps referenced from /etc/auto_master.