Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1544386pxb; Tue, 8 Feb 2022 21:46:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJyjGQJUZiqTI9PkUI6G2dLbbVJoX4Ulp1Q/cVnegT4TNYgqry9eoNgt6yv2NY+0c/OL62md X-Received: by 2002:a17:902:8f8e:: with SMTP id z14mr620816plo.28.1644385584995; Tue, 08 Feb 2022 21:46:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644385584; cv=none; d=google.com; s=arc-20160816; b=QpA4VdL4sh+zQko+sG1D7aG7NZblVbaL+Ibwmrwlf14Wj1GyggeLrK1sdO4wnukxJd LFQjHZOl01me2GAvMkbZy0Mq4n+KwPZFlG1q1GuYeYCXr99a4D7D97ruDEaYwgwj7lG1 bxt/thnG162DMPHhKEmXyuA0acOrCZ07J9x/RBHhLxtloL6Wm/8IDy+NgerlyfLr8BR9 ES7PgWqSX1g0YfRQ4bUt+ZQHLCHvubkOGd/+04lpwLn3uWXEHuf06clV8lM8MiXW1FjQ +CIYGfBXGUaFN7eRKEDyXa4cwnAb2k0FJSHy1wKCLPa5FZ2rdNSKsA0SmEQmgllWQzo8 9D0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=e/AGq6y9fwwWQ5Paoewl9hdqTYn/rggYJIWoUZv43Qw=; b=aNuyuHRgX4kNikN4MkxzYQaY0wVaFpuS/we1+cLAXvfPLQDgyfeXt/XHpW9LOkM/z+ vQT7wP4cvfbWJq/56iVQ3Bsvzib/66518RhTdF3pKLMEYrWsWxBXzFmYkvbLmSbdsEfs PJXQ70vHMEfAa4WMvsjsDz/NSDr4s6pWDHxpL0fEF7hpMWFelKT82ZTBsPVbS5BP1qdp hlRjYzou3s9KayBi5PEe6QuK5eQeEPVBe8oDyCLYJtSZRbNOFx15HlRS4mBdY67Wnkms s9J6+L+WemsFTPidZ9sWiGmwJJVhLdtHAGevFs5PJ0zUxIewrMZRl4VZZ0muprUadWh7 uDqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cUJ4VVY9; spf=softfail (google.com: domain of transitioning linux-nfs-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id r124si7649969pgr.610.2022.02.08.21.46.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Feb 2022 21:46:24 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-nfs-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cUJ4VVY9; spf=softfail (google.com: domain of transitioning linux-nfs-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A326CC014F3E; Tue, 8 Feb 2022 21:42:16 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234429AbiBHWo6 (ORCPT + 99 others); Tue, 8 Feb 2022 17:44:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1387760AbiBHWoo (ORCPT ); Tue, 8 Feb 2022 17:44:44 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7B789C036489 for ; Tue, 8 Feb 2022 14:30:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644359422; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=e/AGq6y9fwwWQ5Paoewl9hdqTYn/rggYJIWoUZv43Qw=; b=cUJ4VVY9CUFSBrfqsRXjCJg6cPInb+qqiteWd7NlMbYR+FzgoACeNDZq9vZIoqwWEhOkLd M3IzfEpSAoqPLpOIdHacb4srsY0NbY7JMgu8ugsbHfWCvPvwGNMAElPNKH+CBT2m+sQ5BW OZx2IDjb9Roc22CZlnW7sJtPLyY16Xg= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-332-SBAQv3stNVGB7Q3b9u0K3Q-1; Tue, 08 Feb 2022 17:30:19 -0500 X-MC-Unique: SBAQv3stNVGB7Q3b9u0K3Q-1 Received: by mail-qt1-f197.google.com with SMTP id br10-20020a05622a1e0a00b002d37e07e79aso345082qtb.4 for ; Tue, 08 Feb 2022 14:30:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=e/AGq6y9fwwWQ5Paoewl9hdqTYn/rggYJIWoUZv43Qw=; b=g1jB178lZuqAgQgZP2a+f8s3i1RUIAMh5BV7cOXQ6xtBdGpQCIKOHXelQmrbjtb0WA 4Ma2Zk94yFytMW2aB0MHWT0oX9Ru8v4eVnAqqzQ6uNE3SFSFmrZ/haJruyoQDco3VuQ6 DxjzIvA0CUkG7VZZHh7Rp8mETdurl3xQ8WPy5WrLC7fWTm4VIcTp18W/7cLpTv3KesQh 0yAtNGDAyMLZePgOi+nJREeGGkXu8bAc+ggfYCUfodsMd+ExC/fBg+t6vqoSfgebKo/Q uh+Djj3AA21IkF/PnTMJuP6pZLW1u6cheap59qGjvlsRcArJ+yCjsfdO7zrKvJ/zT/C0 xS7g== X-Gm-Message-State: AOAM533KVkfKM2klxo6EdEFBLvfzW2wTd+6zwL0wAi3UquujY4Q02AY9 Q0dB43r7mqZjyIYZ0gu74gW4TLANGw9ipHMhmmCQfc7CL+cJcLZjQt7yexKfU0MenbkEMVXx5wD YL5MqbD7C22EKQepCgRfX X-Received: by 2002:a05:622a:112:: with SMTP id u18mr4619027qtw.480.1644359418901; Tue, 08 Feb 2022 14:30:18 -0800 (PST) X-Received: by 2002:a05:622a:112:: with SMTP id u18mr4619017qtw.480.1644359418610; Tue, 08 Feb 2022 14:30:18 -0800 (PST) Received: from [172.31.1.6] ([70.105.253.180]) by smtp.gmail.com with ESMTPSA id u16sm8105320qtx.46.2022.02.08.14.30.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Feb 2022 14:30:18 -0800 (PST) Message-ID: <778c3e11-62e1-00b1-0cbc-514abe1d1eac@redhat.com> Date: Tue, 8 Feb 2022 17:30:17 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [nfs-utils PATCH] nfs4id: a tool to create and persist nfs4 client uniquifiers Content-Language: en-US To: Benjamin Coddington Cc: linux-nfs@vger.kernel.org References: <6f01c382-8da5-5673-30db-0c0099d820b5@redhat.com> <0AB20C82-6200-46E0-A76C-62345DAF8A3A@redhat.com> <6cfb516d-0747-a749-b310-1368a2186307@redhat.com> From: Steve Dickson In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_DNSWL_HI,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Hey! On 2/8/22 3:00 PM, Benjamin Coddington wrote: > On 8 Feb 2022, at 14:52, Steve Dickson wrote: > >> On 2/8/22 11:22 AM, Benjamin Coddington wrote: >>> On 8 Feb 2022, at 11:04, Steve Dickson wrote: >>> >>>> Hello, >>>> >>>> On 2/4/22 7:56 AM, Benjamin Coddington wrote: >>>>> The nfs4id program will either create a new UUID from a random >>>>> source or >>>>> derive it from /etc/machine-id, else it returns a UUID that has >>>>> already >>>>> been written to /etc/nfs4-id.  This small, lightweight tool is >>>>> suitable for >>>>> execution by systemd-udev in rules to populate the nfs4 client >>>>> uniquifier. >>>>> >>>>> Signed-off-by: Benjamin Coddington >>>>> --- >>>>>   .gitignore               |   1 + >>>>>   configure.ac             |   4 + >>>>>   tools/Makefile.am        |   1 + >>>>>   tools/nfs4id/Makefile.am |   8 ++ >>>>>   tools/nfs4id/nfs4id.c    | 184 >>>>> +++++++++++++++++++++++++++++++++++++++ >>>>>   tools/nfs4id/nfs4id.man  |  29 ++++++ >>>>>   6 files changed, 227 insertions(+) >>>>>   create mode 100644 tools/nfs4id/Makefile.am >>>>>   create mode 100644 tools/nfs4id/nfs4id.c >>>>>   create mode 100644 tools/nfs4id/nfs4id.man >>>> Just a nit... naming convention... In the past >>>> we never put the protocol version in the name. >>>> Do a ls tools and utils directory and you >>>> see what I mean.... >>>> >>>> Would it be a problem to change the name from >>>> nfs4id to nfsid? >>> >>> Not at all.. >> Good... > > I didn't orginally do that because I thought it might be confusing for some > folks who want `nfsid` to display their kerberos identity.  There's a BZ > open for that! > > Do you think that's a problem?  I feel like it's a problem. > >>> and I think there's a lot of room for naming discussions about >>> the file to store the id too: >>> >>> Trond sent /etc/nfs4_uuid >>> Neil suggests /etc/netns/NAME/nfs.conf.d/identity.conf >>> Ben sent /etc/nfs4-id (to match /etc/machine-id) >> Question... is it kosher to be writing /etc which is >> generally on the root filesystem? > > Sure, why not? In general, writes to /etc are only happen when packages are installed and removed... any real time writes go to /var or /run (which is not persistent). > >> By far Neil suggestion is the most intriguing... but >> on the containers I'm looking at there no /etc/netns >> directory. > > Not yet -- you can create it. "you" meaning who? the nfs-utils install or network namespace env? Or is it, when /etc/netns exists there is a network namespace and we should use that dir? > >> I had to install the iproute package to do the >> "ip netns identify" which returns NULL... >> also adds yet another dependency on nfs-utils. > > We don't need the dependency..this little binary is just a helper for a > udev > rule.  Trond already wrote his version of this.  :)  This one's just trying > to be a little lighter (whoa, we don't need all of bash!). Fair enough. > >> So if "ip netns identify" does return NULL what directory >> path should be used? > > I think thats out of scope..  if udevd is running in a container, and has a > rule that uses this tool, then the container either is likely to have > already customized its /etc.  Or perhaps we can make the udev rule > namespace > aware (I need to look into what's available to udev's rule environment when > it runs in a namespace). With all do respect... that is a lot of hand waving :-) I'll wait to see what comes you come up with. > >> I'm all for making things container friendly but I'm >> also a fan of keeping things simple... So >> how about /etc/nfs.conf.d/identity.conf or >> /etc/nfs.conf.d/nfsid.conf? > > Really, because its not a configuration.  Its value persistence, and we > /really/ > don't want people configuring it. Good point... and I got it... I was just trying to used the parsing code we already have in place. > >>> >>> Maybe the tool wants an option to specify the file? >> This is probably not a bad idea... It is a common practice > > OK, I'll do that. Thanks! steved. > > Ben >