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