Red Hat Bugzilla – Bug 1418041
Update nfs-utils to use latest upstream configuration style
Last modified: 2017-12-12 04:37:47 EST
Description of problem: Update nfs-utils to the latest upstream version. Setting of configuration options for nfs-utils is clunky at best in RHEL7. - some program options can be set individually in /etc/sysconfig/nfs - others cannot, and instead have be passed in an argument string via /etc/sysconfig/nfs - in order for config changes in /etc/sysconfig/nfs to take effect, it's necessary to restart the nfs-config systemd service, which runs a shell script that parses /etc/sysconfig/nfs and dumps the settings in /run/sysconfig/nfs-utils, where they are sourced via the EnvironmentFile option in the systemd service unit files Upstream nfs-utils has a centralized nfs.conf where almost all of the settings can be specified - the file is structured into stanzas for each program - the programs can read their configurations directly from the file (so you do not need to 'systemctl restart nfs-config.service', you just need to restart the program itself) Having a centralized configuration file will make configuration less error prone, especially for add-on products like High Availability (note that the resource agents would need to change though to take advantage of the new config file). This would also pave the way for any sys-management inititatives that want to implement configuration management. Most of the settings can even be changed via git-config if you're so-inclined. Version-Release number of selected component (if applicable): nfs-utils-1.3.0-0.33.el7 -> nfs-utils-2.1.1 How reproducible: Easy Steps to Reproduce: 1. Apply configuration settings to /etc/nfs.conf 2. Verify that the nfs programs (exportfs, rpc.gssd, lockd, rpc.mountd, nfscltrack, nfsd, rpc.statd, sm-notify) use those settings without requiring additional steps like 'systemctl restart nfs-config.service' 3. Revert the /etc/nfs.conf & apply settings the old way (i.e. vi /etc/sysconfig/nfs && systemctl restart nfs-config.service) 4. Verify that the setings applied the 'old' way still work. Actual results: Expected results: It should be possible to manage nfs configuration settings via either the old way (vi /etc/sysconfig/nfs && systemctl restart nfs-config.service) or via a centralized /etc/nfs.conf. Additional info: 1. To maintain backward compatibility with existing configurations we'll want to keep the existing systemd unit files and scripts in the current nfs-utils. 2. We will need some additional patches: - Allow rpc.mountd & exportfs's state directory to be overridden (I'm working on this now) - Revamp some of the debug logging. The various programs in nfs-utils do not use common debug logging code, and therefore debug logging for some of the programs cannot yet be controlled via nfs.conf... most notably rpc.gssd. It is still possible to enable debug logging via /etc/sysconfig/nfs however (may require a drop-in configuration file for systemd, which can be documented).
Just checked the "Backward compatibility", i.e., when both old and new configuration exist and are conflict, the settings of old way (/etc/sysconfig/nfs) will be applied. -------------------------------------------------- [root@ibm-x3550m3-06 ~]# rpm -q nfs-utils nfs-utils-1.3.0-0.48.el7.x86_64 [root@ibm-x3550m3-06 ~]# cat /etc/sysconfig/nfs RPCNFSDARGS="--port 23456" [root@ibm-x3550m3-06 ~]# cat /etc/nfs.conf [nfsd] port=34567 [root@ibm-x3550m3-06 ~]# systemctl restart nfs-config [root@ibm-x3550m3-06 ~]# systemctl restart nfs [root@ibm-x3550m3-06 ~]# rpcinfo -p | grep -w nfs 100003 3 tcp 23456 nfs 100003 4 tcp 23456 nfs 100003 3 udp 23456 nfs 100003 4 udp 23456 nfs [root@ibm-x3550m3-06 ~]# -------------------------------------------------- However, if we just call the program directly, as it never use the old way (/etc/sysconfig/nfs) to configure it, and program can use settings from /etc/nfs.conf directly, it turns out the new way (/etc/nfs.conf) will be applied. -------------------------------------------------- [root@ibm-x3550m3-06 ~]# systemctl stop nfs [root@ibm-x3550m3-06 ~]# rpc.nfsd [root@ibm-x3550m3-06 ~]# rpcinfo -p | grep -w nfs 100003 3 tcp 34567 nfs 100003 4 tcp 34567 nfs 100003 3 udp 34567 nfs 100003 4 udp 34567 nfs [root@ibm-x3550m3-06 ~]# rpc.nfsd 0 [root@ibm-x3550m3-06 ~]# -------------------------------------------------- IMO, it is expected since calling program directly will start it by default settings previously before this modification. However, seems we'd better to generate some document to explain it some more.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2017:2233