diff --git a/CHANGELOG.md b/CHANGELOG.md index 771e5cdd8..3f2fbf853 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## 0.8.6 (unreleased) - Fix issue with download progress not properly clearing the line. [GH-476] + - NFS should work properly on Fedora. [GH-450] ## 0.8.5 (August 15, 2011) diff --git a/lib/vagrant/hosts.rb b/lib/vagrant/hosts.rb index 852269732..fb3b38856 100644 --- a/lib/vagrant/hosts.rb +++ b/lib/vagrant/hosts.rb @@ -1,8 +1,9 @@ module Vagrant module Hosts autoload :Base, 'vagrant/hosts/base' - autoload :BSD, 'vagrant/hosts/bsd' - autoload :Linux, 'vagrant/hosts/linux' autoload :Arch, 'vagrant/hosts/arch' + autoload :BSD, 'vagrant/hosts/bsd' + autoload :Fedora, 'vagrant/hosts/fedora' + autoload :Linux, 'vagrant/hosts/linux' end end diff --git a/lib/vagrant/hosts/fedora.rb b/lib/vagrant/hosts/fedora.rb new file mode 100644 index 000000000..b85d08f2f --- /dev/null +++ b/lib/vagrant/hosts/fedora.rb @@ -0,0 +1,11 @@ +module Vagrant + module Hosts + class Fedora < Linux + def initialize(*args) + super + + @nfs_server_binary = "/etc/init.d/nfs" + end + end + end +end diff --git a/lib/vagrant/hosts/linux.rb b/lib/vagrant/hosts/linux.rb index b6ec7bed4..d60157d7d 100644 --- a/lib/vagrant/hosts/linux.rb +++ b/lib/vagrant/hosts/linux.rb @@ -10,9 +10,23 @@ module Vagrant def self.distro_dispatch return nil if !Util::Platform.linux? return Arch if File.exist?("/etc/rc.conf") && File.exist?("/etc/pacman.conf") + + if File.exist?("/etc/redhat-version") + # Check if we have a known redhat release + File.open("/etc/redhat-version") do |f| + return Fedora if f.gets =~ /^Fedora/ + end + end + return self end + def initialize(*args) + super + + @nfs_server_binary = "/etc/init.d/nfs-kernel-server" + end + def nfs? retryable(:tries => 10, :on => TypeError) do # Check procfs to see if NFSd is a supported filesystem @@ -37,7 +51,7 @@ module Vagrant # We run restart here instead of "update" just in case nfsd # is not starting - system("sudo /etc/init.d/nfs-kernel-server restart") + system("sudo #{@nfs_server_binary} restart") end def nfs_cleanup