Fixes #7629. nfs-server.service seems to load kernel modules it needs itself, while nfsd appears in `/proc/filesystems` only after the kernel module has been loaded, so vagrant fails to detect NFS server until it's started first time after the system has booted. This checks if the NFS service actually exists and hopes that it'll figure the stuff out itself. `list-unit-files` is utilized rather than `list-units` because systemd seems to not list units that are disabled: https://lists.fedoraproject.org/pipermail/devel/2011-November/159117.html
20 lines
556 B
Ruby
20 lines
556 B
Ruby
module VagrantPlugins
|
|
module HostArch
|
|
module Cap
|
|
class NFS
|
|
def self.nfs_check_command(env)
|
|
return "/usr/sbin/systemctl status --no-pager nfs-server.service"
|
|
end
|
|
|
|
def self.nfs_start_command(env)
|
|
return "/usr/sbin/systemctl start nfs-server.service"
|
|
end
|
|
|
|
def self.nfs_installed(environment)
|
|
Kernel.system("systemctl --no-pager --no-legend --plain list-unit-files --all --type=service | grep --fixed-strings --quiet nfs-server.service")
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|