New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change Fedora 16+ NFS support. #1140
Change Fedora 16+ NFS support. #1140
Conversation
I have tested this code change on a Fedora 17 system and it all works. The only noticeable difference is that the
|
if release_file.exist? | ||
release_file.open("r") do |f| | ||
version_number = /Fedora release ([0-9]+)/.match(f.gets)[1].to_i | ||
if version_number >= 17 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be if version_number >= 16
since systemd was introduced in Fedora 16.
This looks good, just added one quick comment. |
Duly added. Thanks, @skottler. :) |
This looks good. Thanks a ton. And thanks @skottler for doing open source right. Merging. I'll handle porting this to the master branch. |
One nitpick @smerrill: Instead of checking if a file exists, I usually try to open it and just rescue the So instead, I recommend just always opening and catching the exception. Less error cases this way. I made this fix here: 2d710f5 |
Here's a quick-and-dirty pull request to add NFS support to Fedora 17 and up, as reported in #1125.
This simply parses the redhat-release file, and if the version of Fedora is 17 or greater, it changes @nfs_server_binary to
/usr/sbin/service nfs-server
instead of/etc/init.d/nfs
, which does not exist any more in Fedora 17+ due to the switch to systemd.This works because the
service
command in Fedora 17 will rewriteservice nfs-server restart
tosystemctl restart nfs-server.service
behind the scenes. This is the simplest way to solve this issue for now without changing too much code sincelib/vagrant/hosts/linux.rb
callsat the end of nfs_export, whereas calling systemctl would require copying that method and just changing the last line.