minor fix
This commit is contained in:
parent
846b49d7e2
commit
5aabd88007
@ -106,7 +106,7 @@ The program can be configured by editing the [config file](https://github.com/ha
|
|||||||
7. Preventing the slowing down of the program
|
7. Preventing the slowing down of the program
|
||||||
8. Output verbosity
|
8. Output verbosity
|
||||||
|
|
||||||
Just read the description of the parameters and edit the values. Please restart nohang to apply changes. Default path to the config arter installing is `/etc/nohang/nohang.conf`.
|
Just read the description of the parameters and edit the values. Please restart nohang to apply changes. Default path to the config after installing is `/etc/nohang/nohang.conf`.
|
||||||
|
|
||||||
## Feedback
|
## Feedback
|
||||||
|
|
||||||
|
8
nohang
8
nohang
@ -247,15 +247,15 @@ def send_notify(signal, name, pid, oom_score, vm_rss, vm_swap):
|
|||||||
for i in b:
|
for i in b:
|
||||||
username, display_env, dbus_env = i[0], i[1], i[2]
|
username, display_env, dbus_env = i[0], i[1], i[2]
|
||||||
Popen(['sudo', '-u', username, 'env', display_env,
|
Popen(['sudo', '-u', username, 'env', display_env,
|
||||||
dbus_env, 'notify-send', '{}'.format(head),
|
dbus_env, 'notify-send', '--icon=dialog-warning',
|
||||||
'{}'.format(body)])
|
'{}'.format(head), '{}'.format(body)])
|
||||||
else:
|
else:
|
||||||
# отправляем уведомление пользователю, который запустил nohang
|
# отправляем уведомление пользователю, который запустил nohang
|
||||||
Popen(['notify-send', '{}'.format(head), '{}'.format(body)])
|
Popen(['notify-send', '{}'.format(head), '{}'.format(body)])
|
||||||
|
|
||||||
|
|
||||||
def sleep_after_send_signal(signal):
|
def sleep_after_send_signal(signal):
|
||||||
if signal is 9:
|
if signal is signal.SIGKILL:
|
||||||
if print_sleep_periods:
|
if print_sleep_periods:
|
||||||
print(' sleep', min_delay_after_sigkill)
|
print(' sleep', min_delay_after_sigkill)
|
||||||
sleep(min_delay_after_sigterm)
|
sleep(min_delay_after_sigterm)
|
||||||
@ -356,7 +356,7 @@ def find_victim_and_send_signal(signal):
|
|||||||
vm_rss = 0
|
vm_rss = 0
|
||||||
vm_swap = 0
|
vm_swap = 0
|
||||||
|
|
||||||
if name in etc_dict and signal is 15:
|
if name in etc_dict and signal is signal.SIGTERM:
|
||||||
command = etc_dict[name]
|
command = etc_dict[name]
|
||||||
etc_info = ' Process {} is a victim,\n Pid: {}, Badness: {}, VmRSS: {} MiB, VmSwap: {} MiB\n Execute command: {}'.format(name, pid, oom_score, vm_rss, vm_swap, command)
|
etc_info = ' Process {} is a victim,\n Pid: {}, Badness: {}, VmRSS: {} MiB, VmSwap: {} MiB\n Execute command: {}'.format(name, pid, oom_score, vm_rss, vm_swap, command)
|
||||||
os.system(etc_dict[name]) # все норм, это произвольная команда задана юзером
|
os.system(etc_dict[name]) # все норм, это произвольная команда задана юзером
|
||||||
|
Loading…
Reference in New Issue
Block a user