Sha256: 284d3195999fc26fa6031050461348fc5614578eecca69657f2efbf57bce17a9

Contents?: true

Size: 952 Bytes

Versions: 6

Compression:

Stored size: 952 Bytes

Contents

module VagrantPlugins
  module HostArch
    module Cap
      class NFS
        def self.nfs_check_command(env)
          if systemd?
            return "/usr/sbin/systemctl status nfs-server.service"
          else
            return "/etc/rc.d/nfs-server status"
          end
        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
        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'
        end
      end
    end
  end
end

Version data entries

6 entries across 3 versions & 2 rubygems

Version Path
vagrant-unbundled-1.8.1.2 plugins/hosts/arch/cap/nfs.rb
vagrant-unbundled-1.8.1.1 plugins/hosts/arch/cap/nfs.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-1cf2a8db4ccb/plugins/hosts/arch/cap/nfs.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-272fb27e0536/plugins/hosts/arch/cap/nfs.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-309e896975d1/plugins/hosts/arch/cap/nfs.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-b421af58e8b3/plugins/hosts/arch/cap/nfs.rb