fix
This commit is contained in:
parent
2b7436c52d
commit
7bc55b3950
37
nohang
37
nohang
@ -1023,14 +1023,9 @@ def find_victim(_print_proc_table):
|
||||
elif extra_table_info == 'cmdline':
|
||||
extra_table_title = 'cmdline'
|
||||
|
||||
|
||||
elif extra_table_info == 'environ':
|
||||
extra_table_title = 'environ'
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
elif extra_table_info == 'realpath':
|
||||
extra_table_title = 'realpath'
|
||||
|
||||
@ -1803,9 +1798,6 @@ try:
|
||||
exit(1)
|
||||
etc_dict[etc_name] = etc_command
|
||||
|
||||
|
||||
|
||||
|
||||
if line.startswith('@PROCESSNAME_RE'):
|
||||
a = line.partition(
|
||||
'@PROCESSNAME_RE')[2].strip(' \n').partition('///')
|
||||
@ -1855,8 +1847,6 @@ try:
|
||||
environ_re_list.append((badness_adj, reg_exp))
|
||||
|
||||
|
||||
|
||||
|
||||
except PermissionError:
|
||||
errprint('PermissionError', conf_err_mess)
|
||||
exit(1)
|
||||
@ -1874,15 +1864,11 @@ except FileNotFoundError:
|
||||
exit(1)
|
||||
|
||||
|
||||
print(processname_re_list)
|
||||
print(cmdline_re_list)
|
||||
print(uid_re_list)
|
||||
print(environ_re_list)
|
||||
print(realpath_re_list)
|
||||
|
||||
|
||||
|
||||
|
||||
# print(processname_re_list)
|
||||
# print(cmdline_re_list)
|
||||
# print(uid_re_list)
|
||||
# print(environ_re_list)
|
||||
# print(realpath_re_list)
|
||||
|
||||
|
||||
##########################################################################
|
||||
@ -1912,11 +1898,6 @@ re_match_realpath = conf_parse_bool('re_match_realpath')
|
||||
re_match_environ = conf_parse_bool('re_match_environ')
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# if regex_matching or re_match_cmdline or re_match_uid or re_match_cgroup
|
||||
# or re_match_realpath:
|
||||
# from re import search
|
||||
@ -2178,10 +2159,10 @@ else:
|
||||
if 'extra_table_info' in config_dict:
|
||||
extra_table_info = config_dict['extra_table_info']
|
||||
if (extra_table_info != 'None' and extra_table_info != 'cgroup' and
|
||||
extra_table_info != 'cmdline' and extra_table_info != 'environ' and
|
||||
extra_table_info != 'realpath' and extra_table_info != 'All'):
|
||||
errprint('Invalid config: invalid extra_table_info value\nExit')
|
||||
exit(1)
|
||||
extra_table_info != 'cmdline' and extra_table_info != 'environ' and
|
||||
extra_table_info != 'realpath' and extra_table_info != 'All'):
|
||||
errprint('Invalid config: invalid extra_table_info value\nExit')
|
||||
exit(1)
|
||||
else:
|
||||
errprint('Invalid config: extra_table_info is not in config\nExit')
|
||||
exit(1)
|
||||
|
14
nohang.conf
14
nohang.conf
@ -47,12 +47,12 @@
|
||||
MemAvailable levels.
|
||||
|
||||
mem_min_sigterm = 10 %
|
||||
mem_min_sigkill = 2 %
|
||||
mem_min_sigkill = 5 %
|
||||
|
||||
SwapFree levels.
|
||||
|
||||
swap_min_sigterm = 10 %
|
||||
swap_min_sigkill = 2 %
|
||||
swap_min_sigterm = 15 %
|
||||
swap_min_sigkill = 5 %
|
||||
|
||||
Specifying the total share of zram in memory, if exceeded the
|
||||
corresponding signals are sent. As the share of zram in memory
|
||||
@ -235,7 +235,7 @@ re_match_realpath = False
|
||||
|
||||
5.6 Matching environ with RE patterns
|
||||
|
||||
re_match_environ = True
|
||||
re_match_environ = False
|
||||
|
||||
@ENVIRON_RE 100 /// USER=user
|
||||
|
||||
@ -300,12 +300,12 @@ $ETC apache2 /// systemctl restart apache2
|
||||
- OOM prevention results and
|
||||
- low memory warnings
|
||||
|
||||
gui_notifications = True
|
||||
gui_notifications = False
|
||||
|
||||
Enable GUI notifications about the low level of available memory.
|
||||
Valid values are True and False.
|
||||
|
||||
gui_low_memory_warnings = True
|
||||
gui_low_memory_warnings = False
|
||||
|
||||
Execute the command instead of sending GUI notifications if the value is
|
||||
not empty line. For example:
|
||||
@ -362,7 +362,7 @@ print_proc_table = True
|
||||
realpath
|
||||
All
|
||||
|
||||
extra_table_info = environ
|
||||
extra_table_info = None
|
||||
|
||||
print_victim_info = True
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user