2012-05-23 23:03:14 +00:00
|
|
|
require "vagrant"
|
|
|
|
|
|
|
|
require Vagrant.source_root.join("plugins/hosts/linux/host")
|
|
|
|
|
2012-04-19 05:20:45 +00:00
|
|
|
module VagrantPlugins
|
|
|
|
module HostGentoo
|
|
|
|
class Host < VagrantPlugins::HostLinux::Host
|
2012-02-02 22:40:27 +00:00
|
|
|
def self.match?
|
2012-02-08 05:20:33 +00:00
|
|
|
return File.exists?("/etc/gentoo-release")
|
2012-02-02 22:40:27 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
# Normal, mid-range precedence.
|
|
|
|
def self.precedence
|
|
|
|
5
|
|
|
|
end
|
|
|
|
|
|
|
|
def initialize(*args)
|
|
|
|
super
|
|
|
|
|
2013-08-24 10:37:09 +00:00
|
|
|
@nfs_apply_command = "/usr/sbin/exportfs -r"
|
2013-10-16 05:04:21 +00:00
|
|
|
if systemd?
|
|
|
|
@nfs_check_command = "/usr/bin/systemctl status nfsd"
|
|
|
|
@nfs_start_command = "/usr/bin/systemctl start nfsd rpc-mountd rpcbind"
|
|
|
|
else
|
|
|
|
@nfs_check_command = "/etc/init.d/nfs status"
|
|
|
|
@nfs_start_command = "/etc/init.d/nfs start"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
protected
|
|
|
|
|
|
|
|
# Check for systemd presence from current processes.
|
|
|
|
def systemd?
|
|
|
|
`ps -o comm= 1`.chomp == 'systemd'
|
2012-02-02 22:40:27 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|