fix readme

This commit is contained in:
Alexey Avramov 2018-12-14 16:03:13 +09:00
parent 5839b0d8b6
commit 8f43c5528d
2 changed files with 21 additions and 18 deletions

View File

@ -177,6 +177,7 @@ See also `man journalctl`.
- Awful documentation
- Slowly starting, slowly looking for a victim, especially when using swapspace
- It is written in an interpreted language and is actually a prototype
## Contribution

20
nohang
View File

@ -2,13 +2,16 @@
"""A daemon that prevents OOM in Linux systems."""
from time import sleep, time
start_time = time()
import os
from operator import itemgetter
# this is most slow import
from argparse import ArgumentParser
from sys import stdout
from signal import SIGKILL, SIGTERM
sig_dict = {SIGKILL: 'SIGKILL',
SIGTERM: 'SIGTERM'}
'''
@ -16,8 +19,6 @@ nm = 30
nc = nm + 1
'''
stat_dict = dict()
##########################################################################
@ -770,9 +771,6 @@ print('The path to the config:', config)
# conf_parameters_dict
# conf_restart_dict
try:
with open(config) as f:
# dictionary with config options
config_dict = dict()
@ -780,12 +778,17 @@ try:
cmdline_re_list = []
uid_re_list = []
# dictionary with names and commands for the parameter
# execute_the_command
# тут тоже список нужен, а не словарь
etc_dict = dict()
# will store corrective actions stat
stat_dict = dict()
try:
with open(config) as f:
for line in f:
a = line.startswith('#')
@ -823,7 +826,6 @@ try:
a = line.partition('@UID_RE')[2].strip(' \n').partition('///')
uid_re_list.append((a[0].strip(' '), a[2].strip(' ')))
except PermissionError:
print('PermissionError', conf_err_mess)
exit()
@ -1400,7 +1402,7 @@ while True:
else:
# СТОИТ ПЕЧАТАТЬ СВОП ТОЛЬКО ПРИ SwapTotal > 0
# нет, печатать так: SwapTotal = 0 KiB, ignore swapspace
# нет, печатать так: SwapTotal = 0, ignore swapspace
swap_sigterm_pc = '-'
# Limits overdrafting checks