Repository navigation
End the input-device watch and pactl subscribe with the shell - #16154
mrjamesmyers wants to merge 3 commits into
Conversation
Quickshell does not take its Process children along when it stops. The clipboard watchers already start under setpriv --pdeathsig TERM; the inotifywait in Commons/InputDevices.qml and the pactl subscribe in Commons/UntypedInput.qml did not, so each shell restart or crash left them running under init. A quiet /dev/input gives the orphaned inotifywait no event to fail a write on, so it stays until logout. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
[Medium impact] The PR appears safe to merge. SummaryAdds
Reviews (4) · Last reviewed commit: "Cover killed-shell watcher cleanup" · Reviewed by Greptile |
A clean stop already kills these children: omarchy-restart-shell's quickshell kill reaps the old inotifywait on a worker, as Quickshell's Process destructor does. Only a shell that dies without running it (SIGKILL, Qt's _exit on a lost Wayland connection) orphans them, which is what setpriv covers, so the comments no longer say Quickshell never takes its children along. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
|
Thanks for this. I reproduced it on a disposable worker built from the Omarchy ISO, with this branch served by the live session, and the fix works for the deaths it covers. It does not yet cover Quickshell's own crash relaunch, the most common way the shell crashes. What I ran, on base
Pushed: 8c6a9f1 rewrites the two new comments. They said Quickshell never takes its children along when it stops, which the restart test shows is false. Now they say setpriv ends the child if the shell is killed rather than stopped, in two lines. No code changed. Also checked: Second opinion: Codex Medium and muse-spark-1.3 (thinking high) reviewed it over two rounds. Codex found the in-place relaunch gap above, which I then confirmed on the worker. Both flagged the inaccurate comments. muse also suggested Next: this is labelled |
|
Field data for the hard-kill case. Omarchy 4.5.0-3, quickshell 0.3.2.r7.g2b4501a-1, NVIDIA RTX 5060 + AMD iGPU, one monitor. The lock crash loop from #15438 ran for three days here and left 977, then another 981, orphaned All 6210 shell deaths in that boot went through I ran the same one-line change locally ( |
Bring the behavioral SIGKILL regression from omacom#19283 into the older fix so a watcher surviving its shell cannot silently return. Keep the fixture's explicit child cleanup independent of the guard it tests, including when an earlier assertion fails. Co-Authored-By: Alex Muresan <a.muresan8533@gmail.com> Co-Authored-By: GPT-6 High <noreply@openai.com> Co-Authored-By: Opus 5.5 High <noreply@anthropic.com>
|
This branch now includes Alex Muresan's SIGKILL regression from #19283 in 1a6f1cd, with co-authorship credit. It waits for the fixture's input watcher, kills its owning Quickshell process, and checks that the watcher exits. The fixture retains explicit child cleanup so it can clean up even when the guard regresses. On a fresh Omarchy ISO worker running this tree, I checked both actual production children, using a real Pipewire virtual source to activate Worker checks passed: CLI 125, input devices 9, audio 82, audio-output-sink 16, keyboard layout 64, idle spawn 1, and clipboard 84. Four checks initially could not find Node through SSH; they passed after exposing the worker's installed mise runtime. The final worker QML and test files matched the committed files. GPT-6 High in Codex reviewed the updated branch. Opus 5.5 High and muse-wonder via pi, thinking high reviewed the final commit and found no actionable defects. Opus's suggestion to retain explicit fixture cleanup is included; where the reviewers agreed, independence from my review is not guaranteed. The previously documented in-place crash re-exec limitation remains: retaining the parent PID does not trigger the death signal. Startup cleanup remains separate follow-up work. #19283 stays open for the maintainer's decision. The worker checks are complete. The |
|
Thank you @mrjamesmyers (and @dev-arekusandoru for the SIGKILL regression test)! Part of this overlap (startup reaping and |
Problem
Quickshell does not take its
Processchildren along when it stops.PluginRegistry.qmldocuments this and reaps its own watcher at the next start (#15299);plugins/clipboard/Clipboard.qml:293,302starts itswl-paste --watchchildren undersetpriv --pdeathsig TERM. Two other long-running children of the shell have neither:shell/Commons/InputDevices.qml:39-45:inotifywait -mon/dev/input,/devand the udev data dir. On a quiet system it has no event to fail a write on, so after a shell restart or crash the old one stays under init until logout.test/shell.d/input-devices-test.shalready notes that Quickshell "leaves one running when it is stopped itself".shell/Commons/UntypedInput.qml:130:pactl subscribe. It ends at the next audio event (SIGPIPE), so it is brief, but it is a second long-lived child with no owner.The same leak showed up as 63 and 1002 orphaned watchers in #7150 for the plugin directory watcher. #11385 (open) is a pdeathsig PR for that watcher only.
Change
Prefix both commands with
setpriv --pdeathsig TERM, exactly asClipboard.qmldoes.setprivexecs the program, so the pid Quickshell sees is unchanged, and the deathsig survives theexec inotifywaitinside the bash wrapper. No other behavior changes.Not run: the QML was not started (no Linux box was used for this check). Runtime check:
quickshell kill -p /usr/share/omarchy/shell, thenpgrep -a inotifywaitshould show none with the/dev/inputargument.Found while testing Omarchy 4.5.0-rc1.