Sha256: 25cfc284e50d7e524440d31b0a919958816cdaff16bc2076a6537db8bab77945

Contents?: true

Size: 396 Bytes

Versions: 12

Compression:

Stored size: 396 Bytes

Contents

module God
  module Behaviors

    class CleanPidFile < Behavior
      def valid?
        valid = true
        valid &= complain("Attribute 'pid_file' must be specified", self) if self.watch.pid_file.nil?
        valid
      end

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

        "deleted pid file"
      rescue
        "no pid file to delete"
      end
    end

  end
end

Version data entries

12 entries across 12 versions & 3 rubygems

Version Path
resurrected_god-0.14.0 lib/god/behaviors/clean_pid_file.rb
mcproc-2016.2.20 lib/god/behaviors/clean_pid_file.rb
god-0.13.7 lib/god/behaviors/clean_pid_file.rb
god-0.13.6 lib/god/behaviors/clean_pid_file.rb
god-0.13.5 lib/god/behaviors/clean_pid_file.rb
god-0.13.4 lib/god/behaviors/clean_pid_file.rb
god-0.13.3 lib/god/behaviors/clean_pid_file.rb
god-0.13.2 lib/god/behaviors/clean_pid_file.rb
god-0.13.1 lib/god/behaviors/clean_pid_file.rb
god-0.13.0 lib/god/behaviors/clean_pid_file.rb
god-0.12.1 lib/god/behaviors/clean_pid_file.rb
god-0.12.0 lib/god/behaviors/clean_pid_file.rb