From 3519f82b2443855190244ca0d9f1596dae68fffd Mon Sep 17 00:00:00 2001 From: Tomas Krizek Date: Fri, 18 Oct 2019 13:56:51 +0200 Subject: [PATCH 1/3] guest/redhat: fix nfs client installation CentOS 8+ and Fedora 30+ no longer have the alias "nfs" for "nfs-server" systemd service. This shouldn't break backward compatibility, since "nfs-server" service is available on all supported redhat systems that have systemctl binary. Fixes #10838 --- plugins/guests/redhat/cap/nfs_client.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/guests/redhat/cap/nfs_client.rb b/plugins/guests/redhat/cap/nfs_client.rb index f28a04346..e707c7e45 100644 --- a/plugins/guests/redhat/cap/nfs_client.rb +++ b/plugins/guests/redhat/cap/nfs_client.rb @@ -15,7 +15,7 @@ module VagrantPlugins fi if test $(ps -o comm= 1) == 'systemd'; then - /bin/systemctl restart rpcbind nfs + /bin/systemctl restart rpcbind nfs-server else /etc/init.d/rpcbind restart /etc/init.d/nfs restart From fb7a9d5582d05b9ebc9aec23f38ba787dd82efc1 Mon Sep 17 00:00:00 2001 From: Brian Cain Date: Thu, 21 Nov 2019 13:44:28 -0800 Subject: [PATCH 2/3] Remove trailing whitespace --- plugins/guests/redhat/cap/nfs_client.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/guests/redhat/cap/nfs_client.rb b/plugins/guests/redhat/cap/nfs_client.rb index e707c7e45..f9f9f8671 100644 --- a/plugins/guests/redhat/cap/nfs_client.rb +++ b/plugins/guests/redhat/cap/nfs_client.rb @@ -5,7 +5,7 @@ module VagrantPlugins def self.nfs_client_install(machine) machine.communicate.sudo <<-EOH.gsub(/^ {12}/, '') if command -v dnf; then - if `dnf info -q libnfs-utils > /dev/null 2>&1` ; then + if `dnf info -q libnfs-utils > /dev/null 2>&1` ; then dnf -y install nfs-utils libnfs-utils portmap else dnf -y install nfs-utils nfs-utils-lib portmap From 2a2e2d5414d62788a239c29a5a31eaa344fbdd32 Mon Sep 17 00:00:00 2001 From: Brian Cain Date: Thu, 21 Nov 2019 13:44:35 -0800 Subject: [PATCH 3/3] Update nfs client test for redhat --- test/unit/plugins/guests/redhat/cap/nfs_client_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/plugins/guests/redhat/cap/nfs_client_test.rb b/test/unit/plugins/guests/redhat/cap/nfs_client_test.rb index 8cb557c06..55b121eb3 100644 --- a/test/unit/plugins/guests/redhat/cap/nfs_client_test.rb +++ b/test/unit/plugins/guests/redhat/cap/nfs_client_test.rb @@ -24,7 +24,7 @@ describe "VagrantPlugins::GuestRedHat::Cap:NFSClient" do it "installs nfs client" do cap.nfs_client_install(machine) expect(comm.received_commands[0]).to match(/install nfs-utils/) - expect(comm.received_commands[0]).to match(/\/bin\/systemctl restart rpcbind nfs/) + expect(comm.received_commands[0]).to match(/\/bin\/systemctl restart rpcbind nfs-server/) end end end