Merge pull request #156709 from Luflosi/fix-tor-systemd-timeout

This commit is contained in:
Franz Pletz 2022-01-25 15:51:39 +01:00 committed by GitHub
commit 36693d8c28
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -794,6 +794,11 @@ in
};
}));
};
options.ShutdownWaitLength = mkOption {
type = types.int;
default = 30;
description = descriptionGeneric "ShutdownWaitLength";
};
options.SocksPolicy = optionStrings "SocksPolicy" // {
example = ["accept *:*"];
};
@ -977,7 +982,7 @@ in
ExecStart = "${cfg.package}/bin/tor -f ${torrc}";
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
KillSignal = "SIGINT";
TimeoutSec = 30;
TimeoutSec = cfg.settings.ShutdownWaitLength + 30; # Wait a bit longer than ShutdownWaitLength before actually timing out
Restart = "on-failure";
LimitNOFILE = 32768;
RuntimeDirectory = [