Class: God::Behaviors::CleanPidFile
- Inherits:
-
God::Behavior
- Object
- God::Behavior
- God::Behaviors::CleanPidFile
- Defined in:
- lib/god/behaviors/clean_pid_file.rb
Instance Attribute Summary
Attributes inherited from God::Behavior
Instance Method Summary collapse
Methods inherited from God::Behavior
#after_restart, #after_start, #after_stop, #before_restart, #before_stop, #friendly_name, generate
Methods included from Configurable
#base_name, complain, #complain, #friendly_name, #prepare, #reset
Instance Method Details
#before_start ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/god/behaviors/clean_pid_file.rb', line 12 def before_start File.delete(watch.pid_file) 'deleted pid file' rescue 'no pid file to delete' end |
#valid? ⇒ Boolean
6 7 8 9 10 |
# File 'lib/god/behaviors/clean_pid_file.rb', line 6 def valid? valid = true valid &= complain("Attribute 'pid_file' must be specified", self) if watch.pid_file.nil? valid end |