modules(pihole-container): add sleep in ExecStopPost= to force a wait

This is necessary because podman-stop did not wait until the container was actually deleted and `RestartSec=` does not apply if the service is restarted by systemd itself (via restart).
RestartSec only applies if the restart reason is covered by `Restart=`
This commit is contained in:
Christopher Bacher 2022-10-17 01:49:54 +02:00
parent c7048bf7ad
commit 53a4cddd7c

View file

@ -340,10 +340,7 @@ in rec {
} \ } \
docker-archive:${piholeFlake.packages.${pkgs.system}.piholeImage} docker-archive:${piholeFlake.packages.${pkgs.system}.piholeImage}
''; '';
ExecStop = '' ExecStopPost = "${pkgs.coreutils}/bin/sleep 30";
${pkgs.podman}/bin/podman stop ${cfg.hostConfig.containerName}
'';
RestartSec = "5s";
#TODO check that user can control podman & has subuidmap/subgidmap set #TODO check that user can control podman & has subuidmap/subgidmap set
User = "${cfg.hostConfig.user}"; User = "${cfg.hostConfig.user}";
}; };