Module: Specinfra::Command::Module::Service::Runit

Included in:
Base::Service, Runit
Defined in:
lib/specinfra/command/module/service/runit.rb

Instance Method Summary collapse

Instance Method Details

#check_is_enabled_under_runit(service) ⇒ Object



10
11
12
# File 'lib/specinfra/command/module/service/runit.rb', line 10

def check_is_enabled_under_runit(service)
  "test ! -f /etc/sv/#{escape(service)}/down"
end

#check_is_running_under_runit(service) ⇒ Object



6
7
8
# File 'lib/specinfra/command/module/service/runit.rb', line 6

def check_is_running_under_runit(service)
  "sv status #{escape(service)} | grep -E '^run: '"
end

#disable_under_runit(service) ⇒ Object



18
19
20
# File 'lib/specinfra/command/module/service/runit.rb', line 18

def disable_under_runit(service)
  "rm /var/service/#{service}"
end

#enable_under_runit(service) ⇒ Object



14
15
16
# File 'lib/specinfra/command/module/service/runit.rb', line 14

def enable_under_runit(service)
  "ln -s /etc/sv/#{service} /var/service/"
end

#reload_under_runit(service) ⇒ Object



34
35
36
# File 'lib/specinfra/command/module/service/runit.rb', line 34

def reload_under_runit(service)
  "sv reload /var/service/#{service}"
end

#restart_under_runit(service) ⇒ Object



30
31
32
# File 'lib/specinfra/command/module/service/runit.rb', line 30

def restart_under_runit(service)
  "sv restart /var/service/#{service}"
end

#start_under_runit(service) ⇒ Object



22
23
24
# File 'lib/specinfra/command/module/service/runit.rb', line 22

def start_under_runit(service)
  "sv up /var/service/#{service}"
end

#stop_under_runit(service) ⇒ Object



26
27
28
# File 'lib/specinfra/command/module/service/runit.rb', line 26

def stop_under_runit(service)
  "sv down /var/service/#{service}"
end