Sha256: a5edc30c276c6c0841b80479ba6d3f038e89ebf895419113f2f0281a4b255a72

Contents?: true

Size: 549 Bytes

Versions: 3

Compression:

Stored size: 549 Bytes

Contents

require 'sys/proctable'

include Sys

module Commands

  def Commands.kill(options=nil)
    ProcTable.ps().find_all{|p| p.comm =~ /p4d/}
                  .each{|p| Process.kill('TERM', p.pid)}
  end

  def Commands.print_kill_help
    puts <<-END.gsub(/^ {6}/,'')
      p4util kill

      Finds local p4d processes and kills them.

      There should be a timeout that will force kill anything that appears stuck.

      On unix machines, will probably use `ps -x` and 'p4d', then will send
      SIGTERM signals to each process.
    END
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
p4util-0.0.3 ./lib/commands/kill.rb
p4util-0.0.2 ./lib/commands/kill.rb
p4util-0.0.1 ./lib/commands/kill.rb