jcaamano / rpms / vagrant

Forked from rpms/vagrant 2 years ago
Clone
Blob Blame History Raw
From d09e8e6f500d0c6b237ec1979d5fa64025fbc152 Mon Sep 17 00:00:00 2001
From: Yang Sheng Han <progamesigner@gmail.com>
Date: Mon, 13 Jul 2015 14:18:27 +0800
Subject: [PATCH] guests/redhat: Fixed the NFS detection on guest, not host
 [GH-5948]

---
 plugins/guests/redhat/cap/nfs_client.rb | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/plugins/guests/redhat/cap/nfs_client.rb b/plugins/guests/redhat/cap/nfs_client.rb
index 14e69d5..ef88e99 100644
--- a/plugins/guests/redhat/cap/nfs_client.rb
+++ b/plugins/guests/redhat/cap/nfs_client.rb
@@ -15,12 +15,12 @@ def self.nfs_client_installed(machine)
 
         protected
 
-        def self.systemd?
-          `ps -o comm= 1`.chomp == 'systemd'
+        def self.systemd?(machine)
+          machine.communicate.test("test $(ps -o comm= 1) == 'systemd'")
         end
 
         def self.restart_nfs(machine)
-          if systemd?
+          if systemd?(machine)
             machine.communicate.sudo("/bin/systemctl restart rpcbind nfs")
           else
             machine.communicate.sudo("/etc/init.d/rpcbind restart; /etc/init.d/nfs restart")