Skip to content

Commit

Permalink
Enforce Podman containers to restart less often
Browse files Browse the repository at this point in the history
  • Loading branch information
diamondburned committed Feb 9, 2024
1 parent d50ebea commit 351f8bc
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions containers/cs306/test.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{ config, lib, pkgs, ... }:

let
podmanServiceName = containerName: "podman-" + containerName;
in

{
virtualisation.oci-containers =
let
Expand Down Expand Up @@ -62,4 +66,13 @@
};
};
};

systemd.services.${podmanServiceName "experimental-discord-bot"} = {
serviceConfig = {
Restart = "on-failure";
RestartSec = "5s";
};
startLimitBurst = 3;
startLimitIntervalSec = 5 * 60; # 5 minutes
};
}

0 comments on commit 351f8bc

Please sign in to comment.