From 0c9d89ac5a7da6481e8cb523395b6020b1c962be Mon Sep 17 00:00:00 2001 From: Alexey Avramov Date: Wed, 20 Feb 2019 02:18:01 +0900 Subject: [PATCH] add post_kill_exe --- nohang | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/nohang b/nohang index 038d9ef..9b652f4 100755 --- a/nohang +++ b/nohang @@ -86,6 +86,9 @@ print_proc_table = False min_mem_report_interval = 5 +post_kill_exe = '' + + ########################################################################## # define functions @@ -942,6 +945,17 @@ def find_victim_and_send_signal(signal): key = 'Send {} to {}'.format( sig_dict[signal], name) + + if signal is SIGKILL and post_kill_exe != '': + os.system( + post_kill_exe.replace( + '$PID', pid).replace( + '$NAME', pid_to_name(pid) + ) + ) + + + if gui_notifications: send_notify(signal, name, pid)