diff --git a/README.md b/README.md index 0ad8432..f520e60 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ For basic usage: To show GUI notifications: - `libnotify` (Fedora, Arch Linux) or `libnotify-bin` (Debian GNU/Linux, Ubuntu) -- `sudo` and `procps` if nohang is started as root +- `sudo` if nohang is with UID=0 ## Memory and CPU usage diff --git a/nohang b/nohang index b5bd5ab..dd90eb0 100755 --- a/nohang +++ b/nohang @@ -23,7 +23,7 @@ nc = nm + 1 self_uid = os.geteuid() self_pid = str(os.getpid()) -wait_time = 0.1 +wait_time = 2 cache_time = 30 cache_path = '/dev/shm/nohang_env_cache' @@ -348,7 +348,7 @@ def send_notify(signal, name, pid): Popen(['notify-send', '--icon=dialog-warning', '{}'.format(title), '{}'.format(body)]).wait(wait_time) except TimeoutExpired: - print('BAAAR') + print('TimeoutExpired: ' + 'notify send signal') def send_notify_etc(pid, name, command): """ diff --git a/nohang.conf b/nohang.conf index ccb4b69..c9231c9 100644 --- a/nohang.conf +++ b/nohang.conf @@ -15,8 +15,11 @@ 2. The frequency of checking the level of available memory (and CPU usage) 3. The prevention of killing innocent victims - 4. Impact on the badness of processes via matching their names, - cmdlines and UIDs with regular expressions + 4. Impact on the badness of processes via matching their + - names, + - cmdlines and + - UIDs + with regular expressions 5. The execution of a specific command instead of sending the SIGTERM signal 6. GUI notifications: @@ -292,7 +295,7 @@ niceness = -9 Valid values are integers from the range [-1000; 1000]. Setting the values to -1000 will prohibit suicide. -oom_score_adj = -50 +oom_score_adj = -10 Read `man ionice` to understand the following parameters. Setting the True value requires the root privileges. @@ -315,12 +318,12 @@ realtime_ionice_classdata = 4 print_config = False - Print memory check results or not print. + Print memory check results. Valid values are True and False. print_mem_check_results = False - Print sleep periods between memory checks or not print. + Print sleep periods between memory checks. Valid values are True and False. print_sleep_periods = False diff --git a/nohang_notify_low_mem b/nohang_notify_low_mem index e02687c..e21a412 100755 --- a/nohang_notify_low_mem +++ b/nohang_notify_low_mem @@ -14,7 +14,7 @@ from argparse import ArgumentParser from os import listdir from subprocess import Popen, TimeoutExpired -wait_time = 0.1 +wait_time = 2 parser = ArgumentParser()