cosmetic fix

This commit is contained in:
Alexey Avramov 2018-07-22 06:45:20 +09:00
parent db1773a826
commit d8f606ecc6
2 changed files with 12 additions and 15 deletions

4
nohang
View File

@ -483,14 +483,14 @@ try:
c = line.startswith('\t') c = line.startswith('\t')
d = line.startswith(' ') d = line.startswith(' ')
etc = line.startswith('**') etc = line.startswith('$ETC')
if not a and not b and not c and not d and not etc: if not a and not b and not c and not d and not etc:
a = line.split('=') a = line.split('=')
config_dict[a[0].strip()] = a[1].strip() config_dict[a[0].strip()] = a[1].strip()
if etc: if etc:
a = line[2:].split('::') a = line[4:].split('///')
etc_name = a[0].strip() etc_name = a[0].strip()
etc_command = a[1].strip() etc_command = a[1].strip()
if len(etc_name) > 15: if len(etc_name) > 15:

View File

@ -168,23 +168,20 @@ avoid_factor = 3
execute_the_command = False execute_the_command = False
The length of the process name can't exceed 15 characters. The length of the process name can't exceed 15 characters.
The syntax is as follows: lines starting with ** are considered The syntax is as follows: lines starting with keyword $ETC are
as the lines containing names of processes and corresponding considered as the lines containing names of processes and
commands. After a name of process the double colon (::) follows. corresponding commands. After a name of process the triple slash
And then follows the command that will be executed if the (///) follows. And then follows the command that will be
specified process is selected as a victim. executed if the specified process is selected as a victim. The
The ampersand (&) at the end of the command will allow nohang to ampersand (&) at the end of the command will allow nohang to
continue runing without waiting for the end of the command continue runing without waiting for the end of the command
execution. execution.
For example: For example:
** mysqld :: systemctl restart mariadb.service & $ETC mysqld /// systemctl restart mariadb.service &
** php-fpm7.0 :: systemctl restart php7.0-fpm.service $ETC php-fpm7.0 /// systemctl restart php7.0-fpm.service
** processname :: some command $ETC proc_name /// some command
Extra sleep time after executing the command (in addition to
min_sleep_after_sigterm).
##################################################################### #####################################################################
@ -222,7 +219,7 @@ root_display = :0
Для работы опции должны быть включены десктопные уведомления. Для работы опции должны быть включены десктопные уведомления.
Valid values are True and False. Valid values are True and False.
gui_low_memory_warnings = True gui_low_memory_warnings = False
Минимальное время между отправками уведомлений в секундах. Минимальное время между отправками уведомлений в секундах.
Valid values are floating-point numbers from the range [1; 300]. Valid values are floating-point numbers from the range [1; 300].