fix readme
This commit is contained in:
parent
c0fd46440d
commit
911c9e905d
@ -50,7 +50,7 @@ For basic usage:
|
|||||||
|
|
||||||
To show GUI notifications:
|
To show GUI notifications:
|
||||||
- `libnotify` (Fedora, Arch Linux) or `libnotify-bin` (Debian GNU/Linux, Ubuntu)
|
- `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
|
## Memory and CPU usage
|
||||||
|
|
||||||
|
4
nohang
4
nohang
@ -23,7 +23,7 @@ nc = nm + 1
|
|||||||
self_uid = os.geteuid()
|
self_uid = os.geteuid()
|
||||||
self_pid = str(os.getpid())
|
self_pid = str(os.getpid())
|
||||||
|
|
||||||
wait_time = 0.1
|
wait_time = 2
|
||||||
cache_time = 30
|
cache_time = 30
|
||||||
cache_path = '/dev/shm/nohang_env_cache'
|
cache_path = '/dev/shm/nohang_env_cache'
|
||||||
|
|
||||||
@ -348,7 +348,7 @@ def send_notify(signal, name, pid):
|
|||||||
Popen(['notify-send', '--icon=dialog-warning',
|
Popen(['notify-send', '--icon=dialog-warning',
|
||||||
'{}'.format(title), '{}'.format(body)]).wait(wait_time)
|
'{}'.format(title), '{}'.format(body)]).wait(wait_time)
|
||||||
except TimeoutExpired:
|
except TimeoutExpired:
|
||||||
print('BAAAR')
|
print('TimeoutExpired: ' + 'notify send signal')
|
||||||
|
|
||||||
def send_notify_etc(pid, name, command):
|
def send_notify_etc(pid, name, command):
|
||||||
"""
|
"""
|
||||||
|
13
nohang.conf
13
nohang.conf
@ -15,8 +15,11 @@
|
|||||||
2. The frequency of checking the level of available memory
|
2. The frequency of checking the level of available memory
|
||||||
(and CPU usage)
|
(and CPU usage)
|
||||||
3. The prevention of killing innocent victims
|
3. The prevention of killing innocent victims
|
||||||
4. Impact on the badness of processes via matching their names,
|
4. Impact on the badness of processes via matching their
|
||||||
cmdlines and UIDs with regular expressions
|
- names,
|
||||||
|
- cmdlines and
|
||||||
|
- UIDs
|
||||||
|
with regular expressions
|
||||||
5. The execution of a specific command instead of sending the
|
5. The execution of a specific command instead of sending the
|
||||||
SIGTERM signal
|
SIGTERM signal
|
||||||
6. GUI notifications:
|
6. GUI notifications:
|
||||||
@ -292,7 +295,7 @@ niceness = -9
|
|||||||
Valid values are integers from the range [-1000; 1000].
|
Valid values are integers from the range [-1000; 1000].
|
||||||
Setting the values to -1000 will prohibit suicide.
|
Setting the values to -1000 will prohibit suicide.
|
||||||
|
|
||||||
oom_score_adj = -50
|
oom_score_adj = -10
|
||||||
|
|
||||||
Read `man ionice` to understand the following parameters.
|
Read `man ionice` to understand the following parameters.
|
||||||
Setting the True value requires the root privileges.
|
Setting the True value requires the root privileges.
|
||||||
@ -315,12 +318,12 @@ realtime_ionice_classdata = 4
|
|||||||
|
|
||||||
print_config = False
|
print_config = False
|
||||||
|
|
||||||
Print memory check results or not print.
|
Print memory check results.
|
||||||
Valid values are True and False.
|
Valid values are True and False.
|
||||||
|
|
||||||
print_mem_check_results = 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.
|
Valid values are True and False.
|
||||||
|
|
||||||
print_sleep_periods = False
|
print_sleep_periods = False
|
||||||
|
@ -14,7 +14,7 @@ from argparse import ArgumentParser
|
|||||||
from os import listdir
|
from os import listdir
|
||||||
from subprocess import Popen, TimeoutExpired
|
from subprocess import Popen, TimeoutExpired
|
||||||
|
|
||||||
wait_time = 0.1
|
wait_time = 2
|
||||||
|
|
||||||
parser = ArgumentParser()
|
parser = ArgumentParser()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user