Skip to content

Commit

Permalink
Use proper nfsd binary on Fedora [closes hashicorpGH-450]
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellh committed Aug 28, 2011
1 parent 1c2f80f commit 0f0cb27
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
1 change: 1 addition & 0 deletions 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)

Expand Down
3 changes: 2 additions & 1 deletion lib/vagrant/hosts.rb
@@ -1,8 +1,9 @@
module Vagrant
module Hosts
autoload :Base, 'vagrant/hosts/base'
autoload :Arch, 'vagrant/hosts/arch'
autoload :BSD, 'vagrant/hosts/bsd'
autoload :Fedora, 'vagrant/hosts/fedora'
autoload :Linux, 'vagrant/hosts/linux'
autoload :Arch, 'vagrant/hosts/arch'
end
end
11 changes: 11 additions & 0 deletions 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
16 changes: 15 additions & 1 deletion lib/vagrant/hosts/linux.rb
Expand Up @@ -10,9 +10,23 @@ class Linux < Base
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
Expand All @@ -37,7 +51,7 @@ def nfs_export(ip, folders)

# 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
Expand Down

0 comments on commit 0f0cb27

Please sign in to comment.