fix: RuntimeDirectoryPreserve=yes on bash+matrix daemons so they survive rebuild restarts

This commit is contained in:
müde 2026-06-03 19:53:08 +02:00
commit 872d605b4e

View file

@ -1124,6 +1124,18 @@ in
User = userName;
Group = userName;
RuntimeDirectory = "hive-matrix";
# Keep /run/hive-matrix across restarts. With the default
# `RuntimeDirectoryPreserve=no`, a `switch-to-configuration`
# restart races the outgoing instance's stop-time cleanup
# (which deletes the dir) against the incoming instance's
# start (which creates it + binds the socket inside it). The
# cleanup can win and delete the dir out from under the fresh
# daemon, which then fails to mkdir under root-owned /run and
# exits — looping on Restart=on-failure until the next boot.
# `yes` stops systemd removing it on stop; it still creates it
# on first start, and it lives on tmpfs so it's gone at
# container reboot regardless. See hive-bash-daemon below.
RuntimeDirectoryPreserve = "yes";
};
};
@ -1155,6 +1167,13 @@ in
User = userName;
Group = userName;
RuntimeDirectory = "hive-bash";
# See the matching note on hive-matrix-daemon. Without this, a
# post-rebuild restart races stop-time dir cleanup against the
# fresh daemon's socket-dir creation; the daemon loses, fails
# `mkdir /run/hive-bash` (Permission denied, non-root in /run),
# and loops on Restart=on-failure until the next container
# boot — i.e. the bash daemon "doesn't come up post-rebuild".
RuntimeDirectoryPreserve = "yes";
};
};