lib/hawatel_ps/linux/proc_control.rb
def terminate
        process_status = status
        if process_status != 'terminated'
          return status if Process.kill('KILL', @proc_attrs[:pid])
        end
        process_status
      rescue Errno::EPERM
        return 'non-privilaged operation'
      end
# Kill process (equal to Kill -SIGKILL <pid> command)
#
# @example
#   p = HawatelPS.search_by_name('top')
#   p.kill
#
# @return [String] - current process status (running, stopped ..)
Kill process (equal to Kill -SIGKILL  command)
Kill process ( equal to Kill - SIGKILL command )
def terminate
        process_status = status
        if process_status != 'terminated'
          return status if Process.kill('KILL', @proc_attrs[:pid])
        end
        process_status
      rescue Errno::EPERM
        return 'non-privilaged operation'
      end
def terminate process_status = status if process_status != 'terminated' return status if Process . kill ( 'KILL' , @proc_attrs [ :pid ] ) end process_status rescue Errno :: EPERM return 'non-privilaged operation' end
Kill process (equal to Kill -SIGKILL <pid> command)
Kill process ( equal to Kill - SIGKILL <pid > command )
current process status (running, stopped ..)
current process status ( running stopped .. )
String
example
p = HawatelPS.search_by_name('top') p.kill
p = HawatelPS . search_by_name ( ' top ' ) p . kill