Class: God::Behaviors::CleanPidFile

Inherits:
God::Behavior show all
Defined in:
lib/god/behaviors/clean_pid_file.rb

Instance Attribute Summary

Attributes inherited from God::Behavior

#watch

Instance Method Summary collapse

Methods inherited from God::Behavior

#after_restart, #after_start, #after_stop, #before_restart, #before_stop, generate, #prepare

Instance Method Details

#before_startObject



11
12
13
# File 'lib/god/behaviors/clean_pid_file.rb', line 11

def before_start
  File.delete(self.watch.pid_file) rescue nil
end

#valid?Boolean

Returns:

  • (Boolean)


5
6
7
8
9
# File 'lib/god/behaviors/clean_pid_file.rb', line 5

def valid?
  valid = true
  valid &= complain("You must specify the 'pid_file' attribute on the Watch for :clean_pid_file") if self.watch.pid_file.nil?
  valid
end