Cap deluged restarts at 2
`StartLimit` does not exactly cap the number of retries; instead, it specifies a window at the beginning of the service lifespan when the number of retries is capped. Also assert later that the number of restarts is at most 1.
This commit is contained in:
parent
b38616d11f
commit
793c445e78
1 changed files with 18 additions and 3 deletions
|
|
@ -25,6 +25,14 @@ let
|
|||
''
|
||||
print(${node.name}.succeed('journalctl -n100 -u deluged'))
|
||||
print(${node.name}.succeed('systemctl status deluged'))
|
||||
${node.name}.succeed("""
|
||||
restarts="$(systemctl show deluged.service -P NRestarts)"
|
||||
if [ "$restarts" -gt 1 ]; then
|
||||
systemctl status deluged.service --no-pager
|
||||
journalctl -u deluged.service -b --no-pager
|
||||
exit 1
|
||||
fi
|
||||
""")
|
||||
print(${node.name}.succeed('systemctl status delugeweb'))
|
||||
|
||||
with subtest("web connect"):
|
||||
|
|
@ -109,9 +117,16 @@ let
|
|||
settings.content = "localpw";
|
||||
};
|
||||
|
||||
systemd.services.deluged.serviceConfig = {
|
||||
Restart = lib.mkForce "on-failure";
|
||||
RestartSec = "1s";
|
||||
systemd.services.deluged = {
|
||||
unitConfig = {
|
||||
StartLimitIntervalSec = "30s";
|
||||
StartLimitBurst = 2;
|
||||
};
|
||||
|
||||
serviceConfig = {
|
||||
Restart = lib.mkForce "on-failure";
|
||||
RestartSec = "1s";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue