Update nfs & service daemon names for suse based hosts

- nfs.service got recently removed in openSUSE Tumbleweed and calling service
  restart nfs errors out on Tumbleweed. nfs.service has been an alias to
  nfs-client.target for a very long time and can thus be safely substituted.
- all actively supported versions of openSUSE & SLE are using systemd now
  => no reason not to use systemctl
This commit is contained in:
Dan Čermák 2019-09-18 23:15:08 +02:00
parent 9eac6ae62d
commit a3588c28a8
No known key found for this signature in database
GPG Key ID: E632C3380610D1C5
3 changed files with 6 additions and 6 deletions

View File

@ -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

View File

@ -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

View File

@ -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