fix readme
This commit is contained in:
parent
5839b0d8b6
commit
8f43c5528d
@ -177,6 +177,7 @@ See also `man journalctl`.
|
|||||||
|
|
||||||
- Awful documentation
|
- Awful documentation
|
||||||
- Slowly starting, slowly looking for a victim, especially when using swapspace
|
- Slowly starting, slowly looking for a victim, especially when using swapspace
|
||||||
|
- It is written in an interpreted language and is actually a prototype
|
||||||
|
|
||||||
## Contribution
|
## Contribution
|
||||||
|
|
||||||
|
20
nohang
20
nohang
@ -2,13 +2,16 @@
|
|||||||
"""A daemon that prevents OOM in Linux systems."""
|
"""A daemon that prevents OOM in Linux systems."""
|
||||||
from time import sleep, time
|
from time import sleep, time
|
||||||
start_time = time()
|
start_time = time()
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from operator import itemgetter
|
from operator import itemgetter
|
||||||
|
|
||||||
|
# this is most slow import
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
|
|
||||||
from sys import stdout
|
from sys import stdout
|
||||||
from signal import SIGKILL, SIGTERM
|
from signal import SIGKILL, SIGTERM
|
||||||
|
|
||||||
|
|
||||||
sig_dict = {SIGKILL: 'SIGKILL',
|
sig_dict = {SIGKILL: 'SIGKILL',
|
||||||
SIGTERM: 'SIGTERM'}
|
SIGTERM: 'SIGTERM'}
|
||||||
'''
|
'''
|
||||||
@ -16,8 +19,6 @@ nm = 30
|
|||||||
nc = nm + 1
|
nc = nm + 1
|
||||||
'''
|
'''
|
||||||
|
|
||||||
stat_dict = dict()
|
|
||||||
|
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
||||||
|
|
||||||
@ -770,9 +771,6 @@ print('The path to the config:', config)
|
|||||||
# conf_parameters_dict
|
# conf_parameters_dict
|
||||||
# conf_restart_dict
|
# conf_restart_dict
|
||||||
|
|
||||||
try:
|
|
||||||
with open(config) as f:
|
|
||||||
|
|
||||||
# dictionary with config options
|
# dictionary with config options
|
||||||
config_dict = dict()
|
config_dict = dict()
|
||||||
|
|
||||||
@ -780,12 +778,17 @@ try:
|
|||||||
cmdline_re_list = []
|
cmdline_re_list = []
|
||||||
uid_re_list = []
|
uid_re_list = []
|
||||||
|
|
||||||
|
|
||||||
# dictionary with names and commands for the parameter
|
# dictionary with names and commands for the parameter
|
||||||
# execute_the_command
|
# execute_the_command
|
||||||
# тут тоже список нужен, а не словарь
|
# тут тоже список нужен, а не словарь
|
||||||
etc_dict = dict()
|
etc_dict = dict()
|
||||||
|
|
||||||
|
# will store corrective actions stat
|
||||||
|
stat_dict = dict()
|
||||||
|
|
||||||
|
try:
|
||||||
|
with open(config) as f:
|
||||||
|
|
||||||
for line in f:
|
for line in f:
|
||||||
|
|
||||||
a = line.startswith('#')
|
a = line.startswith('#')
|
||||||
@ -823,7 +826,6 @@ try:
|
|||||||
a = line.partition('@UID_RE')[2].strip(' \n').partition('///')
|
a = line.partition('@UID_RE')[2].strip(' \n').partition('///')
|
||||||
uid_re_list.append((a[0].strip(' '), a[2].strip(' ')))
|
uid_re_list.append((a[0].strip(' '), a[2].strip(' ')))
|
||||||
|
|
||||||
|
|
||||||
except PermissionError:
|
except PermissionError:
|
||||||
print('PermissionError', conf_err_mess)
|
print('PermissionError', conf_err_mess)
|
||||||
exit()
|
exit()
|
||||||
@ -1400,7 +1402,7 @@ while True:
|
|||||||
else:
|
else:
|
||||||
|
|
||||||
# СТОИТ ПЕЧАТАТЬ СВОП ТОЛЬКО ПРИ SwapTotal > 0
|
# СТОИТ ПЕЧАТАТЬ СВОП ТОЛЬКО ПРИ SwapTotal > 0
|
||||||
# нет, печатать так: SwapTotal = 0 KiB, ignore swapspace
|
# нет, печатать так: SwapTotal = 0, ignore swapspace
|
||||||
swap_sigterm_pc = '-'
|
swap_sigterm_pc = '-'
|
||||||
|
|
||||||
# Limits overdrafting checks
|
# Limits overdrafting checks
|
||||||
|
Loading…
Reference in New Issue
Block a user