fix: prevent wallpaper daemon race on concurrent starts - #97
Merged
dwilliam62 merged 1 commit intoAug 31, 2026
Merged
Conversation
Checking with "query" or "pgrep" and then starting the daemon is not atomic. Two callers can both see "not running" and both spawn a daemon. The loser panics and aborts with SIGABRT, leaving a core dump behind: thread '<unnamed>' panicked at daemon/src/main.rs:717:55: called `Result::unwrap()` on an `Err` value: "There is an awww-daemon instance already running on this socket!" This triggers on a normal login, where Startup_Apps.conf runs WallpaperDaemon.sh and ApplyThemeMode.sh -> DarkLight.sh concurrently. Add a shared wallpaper_ensure_daemon() to WallpaperCmd.sh that holds an flock while it checks and starts, and use it in the four callers. The daemon does not inherit the lock descriptor, so the lock is released as soon as the daemon is ready. Without flock the previous behaviour is kept, so no new hard dependency is introduced.
Contributor
|
Thanks for this! Regards, |
dwilliam62
added a commit
that referenced
this pull request
Aug 31, 2026
* Updated version to v2.3.26.1 Signed-off-by: Don Williams <don.e.williams@gmail.com> On branch development Changes to be committed: modified: CHANGELOG.md modified: config/hypr/configs/ENVariables.conf modified: config/hypr/lua/env.lua * Merge pull request #97 from hyperion-ak/fix/wallpaper-daemon-race fix: prevent wallpaper daemon race on concurrent starts * remove: unused code (#93) * Updated CHANGELOG Signed-off-by: Don Williams <don.e.williams@gmail.com> * Fixed duplicate waybar on ZorinOS Signed-off-by: Don Williams <don.e.williams@gmail.com> On branch development Your branch is up to date with 'origin/development'. Changes to be committed: modified: config/hypr/scripts/WaybarStartup.sh modified: copy.sh * Fixed waybar restore (again) on upgrades Signed-off-by: Don Williams <don.e.williams@gmail.com> On branch development Your branch is up to date with 'origin/development'. Changes to be committed: modified: copy.sh modified: scripts/lib_copy.sh * Updated CHANGELOG Signed-off-by: Don Williams <don.e.williams@gmail.com> --------- Signed-off-by: Don Williams <don.e.williams@gmail.com> Co-authored-by: hyperion-ak <9286384+hyperion-ak@users.noreply.github.com> Co-authored-by: silesai <silesai@proton.me>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Startup_Apps.confrunsWallpaperDaemon.shandApplyThemeMode.sh->DarkLight.shconcurrently. Both start the wallpaper daemon, and all guardsare check-then-start (
pgreporquery), which is not atomic. When both see"not running", both spawn a daemon and the loser aborts:
One daemon survives, so the desktop works and this is easy to miss, but it
leaves a SIGABRT core dump on every affected login.
Adds
wallpaper_ensure_daemon()toWallpaperCmd.sh(already sourced by allwallpaper scripts) and uses it in the four callers. It holds an
flockacrosscheck and start. The daemon gets
9>&-so it does not inherit the lock fd andhold the lock for its lifetime. Without
flockthe old behaviour is kept.Note:
WallpaperSelect.shloses itsecho "Starting ..."line and itsreadiness wait goes 20 -> 50, matching the other callers.
Type of change
Checklist
Additional context
Arch, Hyprland 0.56.2, awww 0.12.1-1, Hyprland-Dots-v2.3.25