Detect NFS server by service name on Arch

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
This commit is contained in:
Alexander Kurilo 2016-07-23 12:01:34 +03:00
parent f511282d01
commit 73cc633b02
No known key found for this signature in database
GPG Key ID: 11CBC351EB504924
1 changed files with 1 additions and 1 deletions

View File

@ -11,7 +11,7 @@ module VagrantPlugins
end
def self.nfs_installed(environment)
Kernel.system("grep -Fq nfsd /proc/filesystems")
Kernel.system("systemctl --no-pager --no-legend --plain list-unit-files --all --type=service | grep --fixed-strings --quiet nfs-server.service")
end
end
end