Use proper nfsd binary on Fedora [closes GH-450]

This commit is contained in:
Mitchell Hashimoto 2011-08-27 23:47:13 -07:00
parent 1c2f80fab4
commit 0f0cb27e50
4 changed files with 30 additions and 3 deletions

View File

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

View File

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

View File

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

View File

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