Class: Smartware::Driver::Watchdog::WatchdogDaemon
- Inherits:
-
Object
- Object
- Smartware::Driver::Watchdog::WatchdogDaemon
- Defined in:
- lib/smartware/drivers/watchdog/watchdog_daemon.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
Instance Method Summary collapse
-
#initialize(config) ⇒ WatchdogDaemon
constructor
A new instance of WatchdogDaemon.
- #model ⇒ Object
- #reboot_modem ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize(config) ⇒ WatchdogDaemon
Returns a new instance of WatchdogDaemon.
9 10 11 12 |
# File 'lib/smartware/drivers/watchdog/watchdog_daemon.rb', line 9 def initialize(config) @error = nil @config = config end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
7 8 9 |
# File 'lib/smartware/drivers/watchdog/watchdog_daemon.rb', line 7 def error @error end |
Instance Method Details
#model ⇒ Object
14 15 16 |
# File 'lib/smartware/drivers/watchdog/watchdog_daemon.rb', line 14 def model "watchdogd-controlled watchdog" end |
#reboot_modem ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/smartware/drivers/watchdog/watchdog_daemon.rb', line 22 def reboot_modem begin File.open(@config["pidfile"], "r") do |io| pid = io.read.to_i Process.kill :USR1, pid end @error = nil rescue => e Smartware::Logging.logger.warn "Watchdog communication error: #{e}" @error = Interface::Watchdog::WATCHDOG_NOT_AVAILABLE end end |
#version ⇒ Object
18 19 20 |
# File 'lib/smartware/drivers/watchdog/watchdog_daemon.rb', line 18 def version "" end |