Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37352C32789 for ; Thu, 8 Nov 2018 12:00:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 02B5420892 for ; Thu, 8 Nov 2018 12:00:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 02B5420892 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=RedHat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726359AbeKHVft (ORCPT ); Thu, 8 Nov 2018 16:35:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38060 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726252AbeKHVft (ORCPT ); Thu, 8 Nov 2018 16:35:49 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B2F22317FC2B; Thu, 8 Nov 2018 12:00:39 +0000 (UTC) Received: from steved.boston.devel.redhat.com (ovpn-116-214.phx2.redhat.com [10.3.116.214]) by smtp.corp.redhat.com (Postfix) with ESMTP id 42E9D5D75C; Thu, 8 Nov 2018 12:00:39 +0000 (UTC) Subject: Re: [nfs-utils PATCH RFC 6/7] nfsdcld: add /etc/nfs.conf support To: Scott Mayhew Cc: jlayton@kernel.org, linux-nfs@vger.kernel.org References: <20181106183620.18609-1-smayhew@redhat.com> <20181106183620.18609-7-smayhew@redhat.com> From: Steve Dickson Message-ID: <6c30eb21-7be7-accc-78f7-e2544ed46011@RedHat.com> Date: Thu, 8 Nov 2018 07:00:38 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20181106183620.18609-7-smayhew@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Thu, 08 Nov 2018 12:00:39 +0000 (UTC) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On 11/6/18 1:36 PM, Scott Mayhew wrote: > Signed-off-by: Scott Mayhew > --- > nfs.conf | 4 ++++ > utils/nfsdcld/nfsdcld.c | 13 +++++++++++++ > utils/nfsdcld/nfsdcld.man | 15 +++++++++++++++ > 3 files changed, 32 insertions(+) > > diff --git a/nfs.conf b/nfs.conf > index 0d0ec9b..2157b9c 100644 > --- a/nfs.conf > +++ b/nfs.conf > @@ -33,6 +33,10 @@ > # state-directory-path=/var/lib/nfs > # ha-callout= > # > +#[nfsdcld] Staring very recently, all sections are now un-commented > +# debug=0 > +# storagedir=/var/lib/nfs/nfsdcld Does this also need a # pipefsdir=/var/lib/nfs/rpc_pipefs Or are you grabbing that from the [general] section? steved. > +# > #[nfsdcltrack] > # debug=0 > # storagedir=/var/lib/nfs/nfsdcltrack > diff --git a/utils/nfsdcld/nfsdcld.c b/utils/nfsdcld/nfsdcld.c > index 272c7c5..313c68f 100644 > --- a/utils/nfsdcld/nfsdcld.c > +++ b/utils/nfsdcld/nfsdcld.c > @@ -45,6 +45,7 @@ > #include "cld-internal.h" > #include "sqlite.h" > #include "../mount/version.h" > +#include "conffile.h" > > #ifndef DEFAULT_PIPEFS_DIR > #define DEFAULT_PIPEFS_DIR NFS_STATEDIR "/rpc_pipefs" > @@ -640,6 +641,7 @@ main(int argc, char **argv) > char *progname; > char *storagedir = CLD_DEFAULT_STORAGEDIR; > struct cld_client clnt; > + char *s; > > memset(&clnt, 0, sizeof(clnt)); > > @@ -653,6 +655,17 @@ main(int argc, char **argv) > xlog_syslog(0); > xlog_stderr(1); > > + conf_init_file(NFS_CONFFILE); > + s = conf_get_str("general", "pipefs-directory"); > + if (s) > + strlcpy(pipefs_dir, s, sizeof(pipefs_dir)); > + s = conf_get_str("nfsdcld", "storagedir"); > + if (s) > + storagedir = s; > + rc = conf_get_num("nfsdcld", "debug", 0); > + if (rc > 0) > + xlog_config(D_ALL, 1); > + > /* process command-line options */ > while ((arg = getopt_long(argc, argv, "hdFp:s:", longopts, > NULL)) != EOF) { > diff --git a/utils/nfsdcld/nfsdcld.man b/utils/nfsdcld/nfsdcld.man > index b607ba6..c271d14 100644 > --- a/utils/nfsdcld/nfsdcld.man > +++ b/utils/nfsdcld/nfsdcld.man > @@ -163,6 +163,21 @@ Location of the rpc_pipefs filesystem. The default value is > .IX Item "-s storagedir, --storagedir=storage_dir" > Directory where stable storage information should be kept. The default > value is \fI/var/lib/nfs/nfsdcld\fR. > +.SH "CONFIGURATION FILE" > +.IX Header "CONFIGURATION FILE" > +The following values are recognized in the \fB[nfsdcld]\fR section > +of the \fI/etc/nfs.conf\fR configuration file: > +.IP "\fBstoragedir\fR" 4 > +.IX Item "storagedir" > +Equivalent to \fB\-s\fR/\fB\-\-storagedir\fR. > +.IP "\fBdebug\fR" 4 > +.IX Item "debug" > +Setting "debug = 1" is equivalent to \fB\-d\fR/\fB\-\-debug\fR. > +.LP > +In addition, the following value is recognized from the \fB[general]\fR section: > +.IP "\fBpipefs\-directory\fR" 4 > +.IX Item "pipefs-directory" > +Equivalent to \fB\-p\fR/\fB\-\-pipefsdir\fR. > .SH "NOTES" > .IX Header "NOTES" > The Linux kernel NFSv4 server has historically tracked this information >