Restart fprintd after resume so fingerprint auth survives suspend - #9868
Open
balazsorban44 wants to merge 2 commits into
Open
Restart fprintd after resume so fingerprint auth survives suspend#9868balazsorban44 wants to merge 2 commits into
balazsorban44 wants to merge 2 commits into
Conversation
systemd-sleep only runs executables in /usr/lib/systemd/system-sleep/, but omarchy-hibernation-setup and omarchy-toggle-hybrid-gpu copied their hooks with cp -p. That preserved the repository's 644 mode and the invoking user's ownership, so keyboard-backlight and force-igpu were skipped on every suspend and resume without any error. Mark the shipped hooks executable and install them with an explicit mode and owner. A migration repairs installs that already have a non-executable copy. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
fprintd and libfprint do not survive the USB re-enumeration that a suspend or hibernate causes. The daemon holds its pre-sleep handle for the reader, so every later Claim call fails with "Device was already claimed" and pam_fprintd falls through to the password prompt for sudo, polkit and the lock screen. The daemon stays broken until the next reboot and nothing tells the user why. Ship a system-sleep hook that restarts the daemon on resume, install it from omarchy-setup-security-fingerprint, drop it again in the matching remove command, and add a migration for installs that already enrolled a fingerprint. The restart has to happen on "post". A pre-suspend stop loses the race, because fprintd is D-Bus activated and the shell polkit and lock plugins re-activate it before the machine goes down. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Problem
On a laptop with fingerprint authentication configured, fingerprint stops working after the first suspend and stays broken until the next reboot — for
sudo, for polkit, and for the lock screen. There is no error; PAM just falls through to the password prompt, so it reads as "the reader is broken".fprintd/libfprintdo not survive the USB re-enumeration a suspend causes. The daemon keeps its pre-sleep handle for the reader, and every laterClaimfails:Reproduced on a ThinkPad X1 with a Synaptics Prometheus reader (
06cb:00fc), Omarchy 4.0.2, systemd 261. The daemon had been stuck for three days;systemctl restart fprintdclears it immediately.omarchy setup security fingerprintconfigures the three PAM stacks but installs nothing that recovers the daemon on resume.Changes
Two atomic commits.
1.
Install system-sleep hooks as executableFound while following the existing convention for shipping a sleep hook.
systemd-sleepruns only executables in/usr/lib/systemd/system-sleep/(man 8 systemd-suspend.service), butomarchy-hibernation-setupandomarchy-toggle-hybrid-gpuinstall their hooks withcp -p, which preserves the repository's 644 mode and the invoking user's ownership:So
keyboard-backlightandforce-igpuare skipped on every suspend, silently. The commit marks the shipped hooks executable, installs them with an explicit mode and owner, and adds a migration that repairs an existing non-executable copy.2.
Restart fprintd after resume to keep fingerprint auth workingShips
default/systemd/system-sleep/fprintd-reset, installed byomarchy-setup-security-fingerprint, removed byomarchy-remove-security-fingerprint, plus a migration for installs that already enrolled a print.The restart runs on
post, notpre. A pre-suspend stop loses the race:fprintdis D-Bus activated, so the shell polkit and lock plugins re-activate it before the machine goes down.try-restartis a no-op while the daemon is idle, which is its normal state.Testing
./test/all— no new failures. The 4 pre-existing failures reproduce identically on unmodifiedquattro:config,snapperandunowned-system-pathsneed anomarchy-pkgscheckout (OMARCHY_PKGS_PATH) that is not public, andruntime-smokeis the graphical Quickshell test./usr/lib/systemd/system-sleepis already in theallowedset ofunowned-system-paths-test.sh, under the "hardware-conditional sleep hooks, installed only on the machines that need them" rationale, which is exactly how this hook is installed.fprintdon resume is what clears the stale claim: before the restartfprintd-verifyfails withAlreadyInUse; after it,Verify started!and the reader works for sudo, polkit and hyprlock.