Sha256: b0f89dfeaffe2b695cbb78d79366d8e2a99dfc1ac08396aeb571e8de3914b594

Contents?: true

Size: 1.3 KB

Versions: 2

Compression:

Stored size: 1.3 KB

Contents

begin
  require 'util/platform'
rescue LoadError
  raise 'Cannot load Artix platform utilities!'
end

module VagrantArtixHost
  module Cap
    class NFS
      def self.nfs_check_command(_env)
        if VagrantArtixHost::Util::Platform.openrc?
          '/etc/init.d/nfs status'
        elsif VagrantArtixHost::Util::Platform.runit?
          # NOTE: Runit may be monitoring another directory instead of the default /service/
          'sv status /service/nfs'
        elsif VagrantArtixHost::Util::Platform.s6?
          's6-svstat /run/service/nfs'
        elsif VagrantArtixHost::Util::Platform.dinit?
          'dinitctl status nfs'
        else
          # Fallback to init.d
          '/etc/init.d/nfs status'
        end
      end

      def self.nfs_start_command(_env)
        if VagrantArtixHost::Util::Platform.openrc?
          '/etc/init.d/nfs restart'
        elsif VagrantArtixHost::Util::Platform.runit?
          # NOTE: Runit may be monitoring another directory instead of the default /service/
          'sv status /service/nfs'
        elsif VagrantArtixHost::Util::Platform.s6?
          's6-rc -u change nfs'
        elsif VagrantArtixHost::Util::Platform.dinit?
          'dinitctl start nfs'
        else
          # Fallback to init.d
          '/etc/init.d/nfs restart'
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vagrant-host-artix-0.0.3 lib/host/cap/nfs.rb
vagrant-host-artix-0.0.2 lib/host/cap/nfs.rb