Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recipe nfs::_common is restarting nfs-client.target service with every chef-client run on RHEL 8 servers #120

Open
rajeshboyapati opened this issue Aug 13, 2021 · 1 comment

Comments

@rajeshboyapati
Copy link

On RHEL 8 servers, recipe nfs::_common is restarting nfs-client.target service with every chef-client run.
This issue is reproducible with 3.0.0 version of cookbook as well.

[root@app-server-A ~]$ cat /etc/redhat-release 
Red Hat Enterprise Linux release 8.4 (Ootpa)
[root@app-server-A ~]

[root@app-server-A ~]$ date
Fri Aug 13 09:11:38 UTC 2021
[root@app-server-A ~]$ 

[root@app-server-A ~]$ ls -ltr /etc/sysconfig/nfs*
-rw-r--r--. 1 root root 349 Aug 13 09:10 /etc/sysconfig/nfs.rpmsave
[root@app-server-A ~]$
[root@app-server-A ~]$ ls -ltr /etc/nfs*
-rw-r--r--. 1 root root 3606 Jan 20  2021 /etc/nfsmount.conf
-rw-r--r--. 1 root root 1188 Aug 13 09:10 /etc/nfs.conf.rpmsave
-rw-r--r--. 1 root root 1188 Aug 13 09:10 /etc/nfs.conf
[root@app-server-A ~]$

[root@app-server-A ~]$ chef-client -o recipe[nfs::_common]
Starting Chef Client, version 14.15.6
[2021-08-13T08:54:20+00:00] WARN: Run List override has been provided.
[2021-08-13T08:54:20+00:00] WARN: Original Run List: [role[global], role[monitoring]]
[2021-08-13T08:54:20+00:00] WARN: Overridden Run List: [recipe[nfs::_common]]
resolving cookbooks for run list: ["nfs::_common"]
Synchronizing Cookbooks:
  - nfs (2.6.4)
  - line (2.9.3)
Installing Cookbook Gems:
Compiling Cookbooks...
Converging 6 resources
Recipe: nfs::_common
  * dnf_package[nfs-utils] action install (up to date)
  * dnf_package[rpcbind] action install (up to date)
  * directory[/etc/sysconfig] action create (skipped due to only_if)
  * template[/etc/sysconfig/nfs] action create
    - create new file /etc/sysconfig/nfs
    - update content in file /etc/sysconfig/nfs from none to 7b5f09
    --- /etc/sysconfig/nfs	2021-08-13 08:54:25.975261236 +0000
    +++ /etc/sysconfig/.chef-nfs20210813-2380443-176dink	2021-08-13 08:54:25.975261236 +0000
    @@ -1 +1,14 @@
    +# Generated by Chef for app-server-A# Local modifications will be overwritten.
    +# Rendered RHEL template variant
    +STATD_PORT="32765"
    +STATD_OUTGOING_PORT="32766"
    +STATDARG="-p 32765 -o 32766"
    +MOUNTD_PORT="32767"
    +RPCMOUNTDOPTS="-p 32767"
    +LOCKD_UDPPORT="32768"
    +LOCKD_TCPPORT="32768"
    +RQUOTAD_PORT="32769"
    +RQUOTAD="no"
    +RPCNFSDCOUNT="8"
    +
    - change mode from '' to '0644'
    - restore selinux security context
  * service[nfs-client.target] action restart
    - restart service service[nfs-client.target]
  * template[/etc/modprobe.d/lockd.conf] action create (up to date)
  * service[nfs-client.target] action start (up to date)
  * service[nfs-client.target] action enable (up to date)
[2021-08-13T08:54:26+00:00] WARN: Skipping final node save because override_runlist was given

Running handlers:
Running handlers complete
Chef Client finished, 2/8 resources updated in 07 seconds
[root@app-server-A ~]$

[root@app-server-A ~]$ ls -ltr /etc/sysconfig/nfs*
-rw-r--r--. 1 root root 349 Aug 13 09:12 /etc/sysconfig/nfs.rpmsave
[root@app-server-A ~]$
[root@app-server-A ~]$ ls -ltr /etc/nfs*
-rw-r--r--. 1 root root 3606 Jan 20  2021 /etc/nfsmount.conf
-rw-r--r--. 1 root root 1188 Aug 13 09:12 /etc/nfs.conf.rpmsave
-rw-r--r--. 1 root root 1188 Aug 13 09:12 /etc/nfs.conf
[root@app-server-A ~]$

Seems like whenever nfs-client.target service restarts /etc/sysconfig/nfs file is getting moved to /etc/sysconfig/nfs.rpmsave.

As per below Red Hat support links /etc/sysconfig/nfs file is deprecated and replaced by /etc/nfs.conf in RHEL 8.
Considerations in adopting RHEL 8
https://access.redhat.com/solutions/3938381

This issue is reproducible on below type of RHEL 8 servers.
1) Physical servers (like HPE Manufacturer)
2) Amazon EC2 instances

This issue is not reproducible on below type of RHEL 8 server (bcoz /etc/sysconfig/nfs persists).
1) VMware servers

$ ls -ltr /etc/sysconfig/nfs*
-rw-r--r-- 1 root root 1679 Jun  8  2020 /etc/sysconfig/nfs.rpmnew
-rw-r--r-- 1 root root  347 Apr 22 22:51 /etc/sysconfig/nfs.rpmsave
-rw-r--r-- 1 root root  347 Aug 13 09:07 /etc/sysconfig/nfs
@rajeshboyapati
Copy link
Author

This issue is not reproducible on VMware servers bcoz nfs-convert.service is disabled.
nfs-convert.service is a systemctl unit that executes /usr/libexec/nfs-utils/nfsconvert.sh, which calls again /usr/sbin/nfsconvert.

/usr/sbin/nfsconvert is a python script that reads the deprecated /etc/sysconfig/nfs file and set the corresponding values in /etc/nfs.conf. At the end it moves /etc/sysconfig/nfs to /etc/sysconfig/nfs.rpmsave

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant