From 11336d707c4d2e55fc2e6c4b510ef52b964beace Mon Sep 17 00:00:00 2001 From: Alexey Avramov Date: Tue, 5 Feb 2019 21:33:28 +0900 Subject: [PATCH] fix self-defense with SIGSTOP --- nohang | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nohang b/nohang index c068be6..f492fe6 100755 --- a/nohang +++ b/nohang @@ -73,6 +73,7 @@ def stop(): oom_score_r = int( rline1('/proc/' + pid + '/oom_score') ) + print('PID: {}, State: {}, oom_score {}'.format(pid, pid_to_state(pid), oom_score_r)) if uid_r != '0' and oom_score_r > 10: stopped_list.append(pid) print('Send SIGSTOP to {}, {}, {}...'.format( @@ -84,6 +85,8 @@ def stop(): except ProcessLookupError: continue print('Stop time:', t2 - t1) + stdout.flush() + return stopped_list def cont(stopped_list):