class Cfgd::Adapter::Sysvinit
Initsystem
class for systemd based systems
Constants
- SERVICE_BIN
- SERVICE_RESTART_ARGS
- SERVICE_START_ARGS
- SERVICE_STATUS_ARGS
- SERVICE_STOP_ARGS
- SHELL_ENV
Public Class Methods
restart(name)
click to toggle source
# File lib/adapter/initsystem/sysvinit.rb, line 33 def self.restart(name) cmd = "#{SHELL_ENV} #{SERVICE_BIN} #{name} #{SERVICE_RESTART_ARGS}" _stdout, _stderr, status = Open3.capture3(cmd) status.exitstatus.shellexit end
start(name)
click to toggle source
# File lib/adapter/initsystem/sysvinit.rb, line 21 def self.start(name) cmd = "#{SHELL_ENV} #{SERVICE_BIN} #{name} #{SERVICE_START_ARGS}" _stdout, _stderr, status = Open3.capture3(cmd) status.exitstatus.shellexit end
status(name)
click to toggle source
# File lib/adapter/initsystem/sysvinit.rb, line 39 def self.status(name) cmd = "#{SHELL_ENV} #{SERVICE_BIN} #{name} #{SERVICE_STATUS_ARGS}" _stdout, _stderr, status = Open3.capture3(cmd) status.exitstatus.shellexit end
stop(name)
click to toggle source
# File lib/adapter/initsystem/sysvinit.rb, line 27 def self.stop(name) cmd = "#{SHELL_ENV} #{SERVICE_BIN} #{name} #{SERVICE_STOP_ARGS}" _stdout, _stderr, status = Open3.capture3(cmd) status.exitstatus.shellexit end
supports_os?(os)
click to toggle source
# File lib/adapter/initsystem/sysvinit.rb, line 11 def self.supports_os?(os) true if ['freebsd'].include? os end