From 73cc633b02f47f002bea6f66b2a9ae9169c8159d Mon Sep 17 00:00:00 2001 From: Alexander Kurilo Date: Sat, 23 Jul 2016 12:01:34 +0300 Subject: [PATCH] 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 --- plugins/hosts/arch/cap/nfs.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/hosts/arch/cap/nfs.rb b/plugins/hosts/arch/cap/nfs.rb index 24a870d44..1a2dd5f14 100644 --- a/plugins/hosts/arch/cap/nfs.rb +++ b/plugins/hosts/arch/cap/nfs.rb @@ -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