fix: auto-reconnect to usbguard-dbus after restart; polkit dialog no longer breaks on re-setup#4
Merged
Merged
Conversation
… add setup-usbguard step Agent-Logs-Url: https://github.com/SolverNA/usb-auth-guard/sessions/abb2673f-ff57-4942-a925-10083ac77a59 Co-authored-by: SolverNA <213126079+SolverNA@users.noreply.github.com>
… breaks daemon Agent-Logs-Url: https://github.com/SolverNA/usb-auth-guard/sessions/556dc854-81a3-43f2-8b87-b59e94c4586a Co-authored-by: SolverNA <213126079+SolverNA@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
SolverNA
April 23, 2026 01:02
View session
SolverNA
added a commit
that referenced
this pull request
Apr 24, 2026
fix: auto-reconnect to usbguard-dbus after restart; polkit dialog no longer breaks on re-setup
SolverNA
added a commit
that referenced
this pull request
Apr 24, 2026
fix: auto-reconnect to usbguard-dbus after restart; polkit dialog no longer breaks on re-setup
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.
Re-running
sudo make setup-usbguard(or reinstalling without uninstalling first) callssystemctl restart usbguard-dbus, which gives the daemon a new unique D-Bus name. The Python daemon'sconnect_to_signalmatch rule was pinned to the old name — silently receiving nothing, killing the polkit dialog permanently until the user service was manually restarted.Changes
src/usb-auth-guard— reconnect onorg.usbguard1owner changes viabus.watch_name_owner:state['iface'] = Noneconnect_to_signalagainst the new unique nameget_name_owner()for fast-fail ifusbguard-dbusis not runningMakefilesetup-usbguard— after restarting usbguard services, runssystemctl --user -M <uid>@ restart usb-auth-guardfor all logged-in users as a belt-and-suspenders recovery path for daemons running the pre-fix binary.