Add timeoutstopsec as well

This commit is contained in:
Ilia Ross
2023-10-13 10:51:33 +03:00
parent 3cdaaf2950
commit 0d0e9170b9
2 changed files with 9 additions and 7 deletions

View File

@@ -130,13 +130,14 @@ elsif ($init_mode eq "systemd") {
undef,
{ 'pidfile' => "$var_directory/miniserv.pid",
'opts' => {
'env' => '"PERLLIB=' . $root_directory . '"',
'stop' => "$kill \$MAINPID",
'reload' => "$kill -HUP \$MAINPID",
'type' => 'forking',
'restart' => 'always',
'restartsec' => '2s',
'timeout' => '15s',
'env' => '"PERLLIB=' . $root_directory . '"',
'stop' => "$kill \$MAINPID",
'reload' => "$kill -HUP \$MAINPID",
'type' => 'forking',
'restart' => 'always',
'restartsec' => '2s',
'timeout' => '15s',
'timeoutstopsec' => '300s',
}},
);
}

View File

@@ -2380,6 +2380,7 @@ if (ref($opts)) {
&print_tempfile(CFILE, "Restart=$opts->{'restart'}\n") if ($opts->{'restart'});
&print_tempfile(CFILE, "RestartSec=$opts->{'restartsec'}\n") if ($opts->{'restartsec'});
&print_tempfile(CFILE, "TimeoutSec=$opts->{'timeout'}\n") if ($opts->{'timeout'});
&print_tempfile(CFILE, "TimeoutStopSec=$opts->{'timeoutstopsec'}\n") if ($opts->{'timeoutstopsec'});
&print_tempfile(CFILE, "StandardOutput=file:$opts->{'logstd'}\n") if ($opts->{'logstd'});
&print_tempfile(CFILE, "StandardError=file:$opts->{'logerr'}\n") if ($opts->{'logerr'});
}