do not use systemd on current versions of CentOS or RHEL

This commit is contained in:
Matthew 2013-10-05 17:33:13 +01:00
parent bf70fba936
commit d1871b5c15
1 changed files with 8 additions and 5 deletions

View File

@ -37,11 +37,14 @@ module VagrantPlugins
release_file = Pathname.new("/etc/redhat-release")
begin
release_file.open("r:ISO-8859-1:UTF-8") do |f|
version_number = /(CentOS|Fedora|Red Hat Enterprise Linux Server).*release ([0-9]+)/.match(f.gets)[2].to_i
if version_number >= 16
# "service nfs-server" will redirect properly to systemctl
# when "service nfs-server restart" is called.
nfs_server_binary = "/usr/sbin/service nfs-server"
fedora_match = /Fedora.* release ([0-9]+)/.match(f.gets)
if fedora_match
version_number = fedora_match[1].to_i
if version_number >= 16
# "service nfs-server" will redirect properly to systemctl
# when "service nfs-server restart" is called.
nfs_server_binary = "/usr/sbin/service nfs-server"
end
end
end
rescue Errno::ENOENT