Class: VagrantArtixHost::Cap::NFS

Inherits:
Object
  • Object
show all
Defined in:
lib/host/cap/nfs.rb

Class Method Summary collapse

Class Method Details

.nfs_check_command(_env) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/host/cap/nfs.rb', line 10

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

.nfs_start_command(_env) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/host/cap/nfs.rb', line 26

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