Class: God::Behaviors::CleanUnixSocket

Inherits:
God::Behavior show all
Defined in:
lib/god/behaviors/clean_unix_socket.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, #friendly_name, generate

Methods included from Configurable

#base_name, complain, #complain, #friendly_name, #prepare, #reset

Instance Method Details

#before_startObject


11
12
13
14
15
16
17
# File 'lib/god/behaviors/clean_unix_socket.rb', line 11

def before_start
  File.delete(self.watch.unix_socket)

  "deleted unix socket"
rescue
  "no unix socket to delete"
end

#valid?Boolean

Returns:

  • (Boolean)

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

def valid?
  valid = true
  valid &= complain("Attribute 'unix_socket' must be specified", self) if self.watch.unix_socket.nil?
  valid
end