diff --git a/plugins/guests/suse/cap/nfs_client.rb b/plugins/guests/suse/cap/nfs_client.rb index 8a390ef93..69e1f598a 100644 --- a/plugins/guests/suse/cap/nfs_client.rb +++ b/plugins/guests/suse/cap/nfs_client.rb @@ -5,8 +5,8 @@ module VagrantPlugins def self.nfs_client_install(machine) machine.communicate.sudo <<-EOH.gsub(/^ {12}/, '') zypper -n install nfs-client - /sbin/service rpcbind restart - /sbin/service nfs restart + /usr/bin/systemctl restart rpcbind + /usr/bin/systemctl restart nfs-client.target EOH end end diff --git a/plugins/hosts/suse/cap/nfs.rb b/plugins/hosts/suse/cap/nfs.rb index 789c6cb47..ad71c69ec 100644 --- a/plugins/hosts/suse/cap/nfs.rb +++ b/plugins/hosts/suse/cap/nfs.rb @@ -7,11 +7,11 @@ module VagrantPlugins end def self.nfs_check_command(env) - "/sbin/service nfsserver status" + "systemctl status --no-pager nfs-server" end def self.nfs_start_command(env) - "/sbin/service nfsserver start" + "systemctl start --no-pager nfs-server" end end end diff --git a/test/unit/plugins/guests/suse/cap/nfs_client_test.rb b/test/unit/plugins/guests/suse/cap/nfs_client_test.rb index b079b3029..f23e5b8ef 100644 --- a/test/unit/plugins/guests/suse/cap/nfs_client_test.rb +++ b/test/unit/plugins/guests/suse/cap/nfs_client_test.rb @@ -24,8 +24,8 @@ describe "VagrantPlugins::GuestSUSE::Cap::NFSClient" do it "installs nfs client utilities" do cap.nfs_client_install(machine) expect(comm.received_commands[0]).to match(/zypper -n install nfs-client/) - expect(comm.received_commands[0]).to match(/service rpcbind restart/) - expect(comm.received_commands[0]).to match(/service nfs restart/) + expect(comm.received_commands[0]).to match(/systemctl restart rpcbind/) + expect(comm.received_commands[0]).to match(/systemctl restart nfs-client.target/) end end end