From 278b62a809ff7664d4accd88a9016e8a067b2fdb Mon Sep 17 00:00:00 2001 From: Rory& Date: Wed, 21 Jan 2026 07:52:02 +0100 Subject: Stricter ordening for spacebar container, kill shells --- host/Rory-ovh/configuration.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/host/Rory-ovh/configuration.nix b/host/Rory-ovh/configuration.nix index 2d86b19..d6d3461 100755 --- a/host/Rory-ovh/configuration.nix +++ b/host/Rory-ovh/configuration.nix @@ -128,6 +128,19 @@ spacebar ; }; + + # prevent a hang on rebuild with forgotten shells... + systemd.services."container@spacebar" = { + # dependency on postgres for good measure... + after = [ "postgresql.service" ]; + wants = [ "postgresql.service" ]; + preStop = '' + for pid in $(pgrep -f "nixos-container root-login spacebar"); do + echo "Killing shell with PID $pid" + kill -9 $pid + done + ''; + }; #containers."syntest1" = import ./services/containers/syntest1/container.nix { # inherit -- cgit 1.5.1