Module: Specinfra::Command::Module::Service::Daemontools

Included in:
Base::Service
Defined in:
lib/specinfra/command/module/service/daemontools.rb

Instance Method Summary collapse

Instance Method Details

#check_is_enabled_under_daemontools(service) ⇒ Object



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

def check_is_enabled_under_daemontools(service)
  "test -L #{service_dir}/#{escape(service)} && test -f #{service_dir}/#{escape(service)}/run"
end

#check_is_running_under_daemontools(service) ⇒ Object



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

def check_is_running_under_daemontools(service)
  "svstat #{service_dir}/#{escape(service)} | grep -E 'up \\(pid [0-9]+\\)'"
end

#disable_under_daemontools(service) ⇒ Object



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

def disable_under_daemontools(service)
  "( cd #{service_dir}/#{escape(service)} && rm -f #{service_dir}/#{escape(service)} && svc -dx . log )"
end

#enable_under_daemontools(service, directory) ⇒ Object



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

def enable_under_daemontools(service, directory)
  "ln -snf #{escape(directory)} #{service_dir}/#{escape(service)}"
end

#reload_under_daemontools(service) ⇒ Object



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

def reload_under_daemontools(service)
  "svc -h #{service_dir}/#{escape(service)}"
end

#restart_under_daemontools(service) ⇒ Object



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

def restart_under_daemontools(service)
  "svc -t #{service_dir}/#{escape(service)}"
end

#start_under_daemontools(service) ⇒ Object



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

def start_under_daemontools(service)
  "svc -u #{service_dir}/#{escape(service)}"
end

#stop_under_daemontools(service) ⇒ Object



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

def stop_under_daemontools(service)
  "svc -d #{service_dir}/#{escape(service)}"
end