From 9ec3c16d06acc3c496634f4952e1f8dc73a7de1c Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Fri, 5 Jun 2026 11:06:01 +0100 Subject: fix(systemd): drop StopWhenUnneeded from sway-session.target The target reached active then was immediately garbage-collected: Reached target sway compositor session Stopped target sway compositor session Stopping swayr.../Waybar... Nothing holds a reverse dependency on sway-session.target, so the first "stop unneeded units" pass (triggered when any Wanted service transitions, e.g. a ConditionEnvironment skip during the env-import race) found it unneeded and StopWhenUnneeded=yes tore it down, cascading via PartOf/ BindsTo to every session service. Manual `systemctl --user start` worked because that starts the service directly, not the GC-prone target. StopWhenUnneeded has been latent since 030848c; the nix migration's changed startup timing exposed it. The canonical sway-session.target omits it; teardown still works via BindsTo=graphical-session.target and user-manager shutdown at logout (swaymsg exit). --- dot_config/systemd/user/sway-session.target | 1 - 1 file changed, 1 deletion(-) diff --git a/dot_config/systemd/user/sway-session.target b/dot_config/systemd/user/sway-session.target index b5f06eb..2c31361 100644 --- a/dot_config/systemd/user/sway-session.target +++ b/dot_config/systemd/user/sway-session.target @@ -4,4 +4,3 @@ Documentation=man:systemd.special(7) BindsTo=graphical-session.target Wants=graphical-session-pre.target mako.service poweralertd.service display-watcher.service swayidle.service cliphist-text.service cliphist-image.service waybar.service signal.service After=graphical-session-pre.target -StopWhenUnneeded=yes -- cgit v1.3.1