From d1871b5c1522e6a54325e1acd6cbbdb35dae3f5a Mon Sep 17 00:00:00 2001 From: Matthew Date: Sat, 5 Oct 2013 17:33:13 +0100 Subject: [PATCH] do not use systemd on current versions of CentOS or RHEL --- plugins/hosts/fedora/host.rb | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/plugins/hosts/fedora/host.rb b/plugins/hosts/fedora/host.rb index c8fef743c..ec7501633 100644 --- a/plugins/hosts/fedora/host.rb +++ b/plugins/hosts/fedora/host.rb @@ -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