guests/redhat: Fixed the NFS detection on guest, not host [GH-5948]

This commit is contained in:
Yang Sheng Han 2015-07-13 14:18:27 +08:00
parent 0796f052f0
commit d09e8e6f50
1 changed files with 3 additions and 3 deletions

View File

@ -15,12 +15,12 @@ module VagrantPlugins
protected protected
def self.systemd? def self.systemd?(machine)
`ps -o comm= 1`.chomp == 'systemd' machine.communicate.test("test $(ps -o comm= 1) == 'systemd'")
end end
def self.restart_nfs(machine) def self.restart_nfs(machine)
if systemd? if systemd?(machine)
machine.communicate.sudo("/bin/systemctl restart rpcbind nfs") machine.communicate.sudo("/bin/systemctl restart rpcbind nfs")
else else
machine.communicate.sudo("/etc/init.d/rpcbind restart; /etc/init.d/nfs restart") machine.communicate.sudo("/etc/init.d/rpcbind restart; /etc/init.d/nfs restart")