Sha256: 9ef88c6684d0d38cff1c88c6818e19c3ef0bd1897371b93048fa819eea29e94c

Contents?: true

Size: 459 Bytes

Versions: 6

Compression:

Stored size: 459 Bytes

Contents

module Perus::Pinger
    class KillProcess < Command
        description 'Kills all instances of a process. Valid values for
                     "process_name" are contained in the pinger config file.'
        option :process_name, restricted: true
        option :signal, default: 'KILL'

        def run
            result = shell("killall -#{option.signal} #{option.process_name}")
            true # shell will capture any errors
        end
    end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
perus-0.1.8 lib/perus/pinger/commands/kill_process.rb
perus-0.1.7 lib/perus/pinger/commands/kill_process.rb
perus-0.1.6 lib/perus/pinger/commands/kill_process.rb
perus-0.1.5 lib/perus/pinger/commands/kill_process.rb
perus-0.1.4 lib/perus/pinger/commands/kill_process.rb
perus-0.1.3 lib/perus/pinger/commands/kill_process.rb