Linux NFS development
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.com>
To: "J. Bruce Fields" <bfields@redhat.com>,
	Steve Dickson <SteveD@redhat.com>
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH 15/15] Add nfs.systemd man page
Date: Fri, 02 Dec 2016 14:58:30 +1100	[thread overview]
Message-ID: <148065111043.28046.3858869219236614683.stgit@noble> (raw)
In-Reply-To: <148065078775.28046.5506130555300891075.stgit@noble>

This discusses some of the behaviors of the various
unit files, and how best to work with them to achieve
various results.

Signed-off-by: NeilBrown <neilb@suse.com>
---
 systemd/Makefile.am     |    4 +
 systemd/nfs.systemd.man |  167 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 169 insertions(+), 2 deletions(-)
 create mode 100644 systemd/nfs.systemd.man

diff --git a/systemd/Makefile.am b/systemd/Makefile.am
index b5ab157d728b..0d15b9f25ff8 100644
--- a/systemd/Makefile.am
+++ b/systemd/Makefile.am
@@ -36,8 +36,8 @@ endif
 endif
 
 man5_MANS	= nfs.conf.man
-
-EXTRA_DIST = $(unit_files) $(man5_MANS)
+man7_MANS	= nfs.systemd.man
+EXTRA_DIST = $(unit_files) $(man5_MANS) $(man7_MANS)
 
 unit_dir = /usr/lib/systemd/system
 generator_dir = /usr/lib/systemd/system-generators
diff --git a/systemd/nfs.systemd.man b/systemd/nfs.systemd.man
new file mode 100644
index 000000000000..01801ebb5f2c
--- /dev/null
+++ b/systemd/nfs.systemd.man
@@ -0,0 +1,167 @@
+.TH NFS.SYSTEMD 7
+.SH NAME
+nfs.systemd \- managing NFS services through systemd.
+.SH SYNOPSIS
+nfs-utils.service
+.br
+nfs-server.service
+.br
+nfs-client.target
+.br
+.I etc
+.SH DESCRIPTION
+The
+.I nfs-utils
+package provides a suite of
+.I systemd
+unit files which allow the various services to be started and
+managed.  These unit files ensure that the services are started in the
+correct order, and the prerequisites are active before dependant
+services start.  As there are quite  few unit files, it is not
+immediately obvious how best to achieve certain results.  The
+following subsections attempt to cover the issues that are most likely
+to come up.
+.SS Configuration
+The standard systemd unit files do not provide any easy way to pass
+any command line arguments to daemons so as to configure their
+behavior.  In many case such configuration can be performed by making
+changes to
+.I /etc/nfs.conf
+or other configuration files.  When that is not convenient, a
+distribution might provide systemd "drop-in" files which replace the
+.B ExecStart=
+setting to start the program with different arguments.  For example a
+drop-in file
+.B systemd/system/nfs-mountd.service.d/local.conf
+containing
+.RS
+.nf
+[Service]
+EnvironmentFile=/etc/sysconfig/nfs
+ExecStart=
+ExecStart= /usr/sbin/rpc.mountd $RPCMOUNTDOPTS
+.fi
+.RE
+would cause the
+.B nfs-mountd.service
+unit to run the
+.I rpc.mountd
+program using, for arguments, the value given for
+.B RPCMOUNTDOPTS
+in
+.IR /etc/sysconfig/nfs .
+This allows for seamless integration with existing configuration
+tools.
+.SS Enabling unit files
+There are three unit files which are designed to be manually enabled.
+All others are automatically run as required.  The three are:
+.TP
+.B nfs-client.target
+This should be enabled on any host which ever serves as an NFS client.
+There is little cost in transparently enabling it whenever NFS client
+software is installed.
+.TP
+.B nfs-server.service
+This must be enabled to provide NFS service to clients.  It starts and
+configures the required daemons in the required order.
+.TP
+.B nfs-blkmap.service
+The
+.B blkmapd
+daemon is only required on NFS clients which are using pNFS (parallel
+NFS), and particularly using the
+.B blocklayout
+layout protocol.  If you might use this particular extension to NFS,
+the
+.B nfs-blkmap.service
+unit should be enabled.
+.PP
+Several other units which might be considered to be optional, such as
+.I rpc-gssd.service
+are careful to only start if the required configuration file exists.
+.I rpc-gsdd.service
+will not start if the
+.I krb5.keytab
+file does not exist (typically in
+.IR /etc ).
+.SS Restarting NFS services
+Most NFS daemons can be restarted at any time.  They will reload any
+state that they need, and continue servicing requests.  This is rarely
+necessary though.
+.PP
+When configuration changesare make, it can be hard to know exactly
+which services need to be restarted to ensure that the configuration
+takes effect.  The simplest approach, which is often the best, is to
+restart everything.  To help with this, the
+.B nfs-utils.service
+unit is provided.  It declares appropriate dependencies with other
+unit files so that
+.RS
+.B systemctl restart nfs-utils
+.RE
+will restart all NFS daemons that are running.  This will cause all
+configuration changes to take effect
+.I except
+for changes to mount options lists in
+.I /etc/fstab
+or
+.IR /etc/nfsmount.conf .
+Mount options can only be changed by unmounting and remounting
+filesystem.  This can be a disruptive operation so it should only be
+done when the value justifies the cost.  The command
+.RS
+.B umount -a -t nfs; mount -a -t nfs
+.RE
+should unmount and remount all NFS filesystems.
+.SS Masking unwanted services
+Rarely there may be a desire to prohibit some services from running
+even though there are normally part of a working NFS system.  This may
+be needed to reduce system load to an absolute minimum, or to reduce
+attack surface by not running daemons that are not absolutely
+required.
+.PP
+Two particular services which this can apply to are
+.I rpcbind
+and
+.IR idmapd .
+.I rpcbind
+is not part of the
+.I nfs-utils
+package, but it used by several NFS services.  However it is
+.B not
+needed when only NFSv4 is in use.  If a site will never use NFSv3 (or
+NFSv2) and does not want
+.I rpcbind
+to be running, the correct approach is to run
+.RS
+.B systemctl mask rpcbind
+.RE
+This will disable
+.IR rpcbind ,
+and the various NFS services which depend on it (and are only needed
+for NFSv3) will refuse to start, without interfering with the
+operation of NFSv4 services.  In particular,
+.I rpc.statd
+will not run when
+.I rpcbind
+is masked.
+.PP
+.I idmapd
+is only needed for NFSv4, and even then is not needed when the client
+and server agree to use user-ids rather than user-names to identify the
+owners of files.  If
+.I idmapd
+is not needed and not wanted, it can be masked with
+.RS
+.B systemctl mask idmapd
+.RE
+.SH FILES
+/etc/nfs.conf
+.br
+/etc/nfsmount.conf
+.br
+/etc/idmapd.conf
+.SH SEE ALSO
+.BR systemd.unit (5),
+.BR nfs.conf (5),
+.BR nfsmount.conf (5).



  parent reply	other threads:[~2016-12-02  4:00 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-02  3:58 [RFC PATCH 00/15] Enhance /etc/nfs.conf usage and remove nfs-config.service NeilBrown
2016-12-02  3:58 ` [PATCH 04/15] Add /etc/nfs.conf support for mountd NeilBrown
2016-12-02  3:58 ` [PATCH 01/15] Add man-page describing /etc/nfs.conf NeilBrown
2016-12-02  3:58 ` [PATCH 05/15] Add /etc/nfs.conf support for statd NeilBrown
2016-12-02  3:58 ` [PATCH 03/15] Add /etc/nfs.conf support to rpc.nfsd NeilBrown
2016-12-05 22:27   ` J. Bruce Fields
2016-12-05 22:42     ` NeilBrown
2016-12-06 17:52   ` Steve Dickson
2016-12-06 22:30     ` NeilBrown
2016-12-07 14:34       ` Steve Dickson
2016-12-06 18:51   ` Steve Dickson
2016-12-06 22:36     ` NeilBrown
2016-12-07 14:44       ` Steve Dickson
2016-12-07 18:08         ` J. Bruce Fields
2016-12-07 23:14           ` NeilBrown
2016-12-08  0:38             ` Steve Dickson
2016-12-09 22:43             ` J. Bruce Fields
2016-12-20 23:22       ` NeilBrown
2016-12-21  1:55         ` J. Bruce Fields
2016-12-02  3:58 ` [PATCH 02/15] conffile: add bool support NeilBrown
2016-12-02  3:58 ` [PATCH 10/15] conffile: strip "quotes" from values in conf file NeilBrown
2016-12-02  3:58 ` [PATCH 07/15] conffile: free image of config file after parsing NeilBrown
2016-12-02  3:58 ` [PATCH 09/15] conffile: add support for include files NeilBrown
2016-12-02  3:58 ` [PATCH 08/15] conffile: split loading of file into a separate function NeilBrown
2016-12-02  3:58 ` [PATCH 06/15] Add /etc/nfs.conf support for sm-notify NeilBrown
2016-12-02  3:58 ` [PATCH 11/15] conffile: ignore setting of empty string NeilBrown
2016-12-02  3:58 ` [PATCH 12/15] conffile: allow $name expansion of tag values NeilBrown
2016-12-02  3:58 ` NeilBrown [this message]
2016-12-02  3:58 ` [PATCH 14/15] systemd: Remove the nfs-config.service NeilBrown
2016-12-02  3:58 ` [PATCH 13/15] statd: allow --no-notify to be passed via environment variable NeilBrown
2016-12-02 15:56 ` [RFC PATCH 00/15] Enhance /etc/nfs.conf usage and remove nfs-config.service J. Bruce Fields
2016-12-06 16:55 ` Steve Dickson
2016-12-06 22:38   ` NeilBrown
2016-12-07 14:24     ` Steve Dickson
2016-12-06 17:26 ` J. Bruce Fields
2016-12-06 22:47   ` NeilBrown
2016-12-07 14:19     ` J. Bruce Fields
2016-12-06 19:25 ` Steve Dickson
2016-12-06 22:51   ` NeilBrown
2016-12-07 14:21     ` Steve Dickson
2016-12-20 18:33 ` Steve Dickson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=148065111043.28046.3858869219236614683.stgit@noble \
    --to=neilb@suse.com \
    --cc=SteveD@redhat.com \
    --cc=bfields@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox