modules(pihole-container): improve stopping of the container

The service only waits until the container has been stopped.
This commit is contained in:
Christopher Bacher 2022-10-18 21:04:39 +02:00
parent 53a4cddd7c
commit 8c58832c7d

View file

@ -340,10 +340,15 @@ in rec {
} \
docker-archive:${piholeFlake.packages.${pkgs.system}.piholeImage}
'';
ExecStopPost = "${pkgs.coreutils}/bin/sleep 30";
#TODO check that user can control podman & has subuidmap/subgidmap set
User = "${cfg.hostConfig.user}";
};
postStop = ''
while ${pkgs.podman}/bin/podman container exists ${cfg.hostConfig.containerName}; do
${pkgs.coreutils-full}/bin/sleep 2;
done
'';
};
};
}