fix new conf
This commit is contained in:
parent
1e91e6b0da
commit
16eab59cc1
8
nohang
8
nohang
@ -768,7 +768,7 @@ def find_victim_and_send_signal(signal):
|
||||
command = etc_dict[name]
|
||||
if stop_cont:
|
||||
os.kill(int(pid), SIGCONT)
|
||||
exit_status = os.system(etc_dict[name].replace('$PID', pid))
|
||||
exit_status = os.system(etc_dict[name].replace('$PID', pid)).replace('$NAME', pid_to_name(pid)))
|
||||
if exit_status == 0:
|
||||
exit_status = '\033[32m0\033[0m'
|
||||
else:
|
||||
@ -779,11 +779,11 @@ def find_victim_and_send_signal(signal):
|
||||
etc_info = '{}' \
|
||||
'\n\033[4mImplement corrective action:\033[0m\n Execute the command: \033[4m{}\033[0m' \
|
||||
'\n Exit status: {}; response time: {} ms'.format(
|
||||
victim_info, command.replace('$PID', pid), exit_status,
|
||||
victim_info, command.replace('$PID', pid).replace('$NAME', pid_to_name(pid)), exit_status,
|
||||
round(response_time * 1000))
|
||||
|
||||
# update stat_dict
|
||||
key = "Run the command '\033[35m{}\033[0m'".format(command.replace('$PID', pid))
|
||||
key = "Run the command '\033[35m{}\033[0m'".format(command.replace('$PID', pid).replace('$NAME', pid_to_name(pid)))
|
||||
print(key)
|
||||
update_stat_dict_and_print(key)
|
||||
|
||||
@ -791,7 +791,7 @@ def find_victim_and_send_signal(signal):
|
||||
print(etc_info)
|
||||
|
||||
if gui_notifications:
|
||||
send_notify_etc(pid, name, command.replace('$PID', pid))
|
||||
send_notify_etc(pid, name, command.replace('$PID', pid).replace('$NAME', pid_to_name(pid)))
|
||||
|
||||
else:
|
||||
|
||||
|
@ -238,6 +238,8 @@ execute_the_command = False
|
||||
It is way to send any signal instead of SIGTERM.
|
||||
(run `kill -L` to see list of all signals)
|
||||
|
||||
Also $NAME will be replaced by process name.
|
||||
|
||||
$ETC bash /// kill -9 $PID
|
||||
$ETC firefox-esr /// kill -SEGV $PID
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user