From 919f3ee4e4432b837fedf9e1d26027a93e1625a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Piotrowski?= Date: Tue, 29 Mar 2016 11:24:01 +0200 Subject: [PATCH] Remove sysvinit else clauses in NFS for Arch Linux Currently the code tries to detect if Arch uses systemd via checking comm= of PID 1. As access to proc filesystem might be restricted due to hideproc set and systemd is default for all Arch Linux installations since October 2012, let's just ditch that check. --- plugins/hosts/arch/cap/nfs.rb | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/plugins/hosts/arch/cap/nfs.rb b/plugins/hosts/arch/cap/nfs.rb index eb0c656f2..24a870d44 100644 --- a/plugins/hosts/arch/cap/nfs.rb +++ b/plugins/hosts/arch/cap/nfs.rb @@ -3,31 +3,15 @@ module VagrantPlugins module Cap class NFS def self.nfs_check_command(env) - if systemd? - return "/usr/sbin/systemctl status --no-pager nfs-server.service" - else - return "/etc/rc.d/nfs-server status" - end + return "/usr/sbin/systemctl status --no-pager nfs-server.service" end def self.nfs_start_command(env) - if systemd? - return "/usr/sbin/systemctl start nfs-server.service" - else - return "sh -c 'for s in {rpcbind,nfs-common,nfs-server}; do /etc/rc.d/$s start; done'" - end + return "/usr/sbin/systemctl start nfs-server.service" end def self.nfs_installed(environment) - Kernel.system("grep -Fq nfs /proc/filesystems") - end - - protected - - # This tests to see if systemd is used on the system. This is used - # in newer versions of Arch, and requires a change in behavior. - def self.systemd? - `ps -o comm= 1`.chomp == 'systemd' + Kernel.system("grep -Fq nfsd /proc/filesystems") end end end