Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No U2F events captured after boot #48

Open
Majiir opened this issue Oct 6, 2023 · 3 comments
Open

No U2F events captured after boot #48

Majiir opened this issue Oct 6, 2023 · 3 comments

Comments

@Majiir
Copy link

Majiir commented Oct 6, 2023

I use the systemd user service to run yubikey-touch-detector. I'm using NixOS 23.05 with GNOME 44.2.

When I first boot my machine, no U2F events are captured. (I don't use any other watchers.) The logs indicate successful startup of the service:

time="2023-10-06T17:24:42-04:00" level=debug msg="Starting YubiKey touch detector"
time="2023-10-06T17:24:42-04:00" level=debug msg="No 'gpg' binary in $PATH or '/home/majiir/.gnupg/pubring.kbx' could not be found. Disabling GPG and SSH watchers."
time="2023-10-06T17:24:42-04:00" level=debug msg="U2F watcher on '/dev' is successfully established"
time="2023-10-06T17:24:42-04:00" level=debug msg="HMAC watcher on '/dev' is successfully established"

However, no events are recorded in the logs, sent to the unix socket, or notified through libnotify.

The issue can be fixed by restarting the service or by unplugging and replugging the Yubikey (which is already inserted when the machine boots). In the latter case, the logs simply start recording events as usual.

Is the service missing a dependency? I noticed that it doesn't require dbus.socket, but adding that didn't fix the issue. The issue seems to be related to the watchers.

@maximbaz
Copy link
Owner

maximbaz commented Oct 6, 2023

Another interesting issue! The U2F watcher depends on the presence of /dev/hidraw* devices, it's quite interesting that those are not present on your system yet, when the app launches.

This page has some diagrams of the order of systemd dependencies: https://man7.org/linux/man-pages/man7/bootup.7.html

I can't easily find the problem though, default.target seems to be executed quite late... Can you spot a possible dependency?

@anpin
Copy link

anpin commented Dec 27, 2023

Hi, I have been faced with the same issue. In nixos current implementation of the systemd service is wanted by graphical-session.target, not default.target. However overriding it doesn't fix the issue.

I do see the notification If I run the binary manually, with -v -no-socket in parallel to the service [1], but not if I add the same flags to the systemd environment variables, or run the binary without the service [2].

[1] image
[2] image

@anpin
Copy link

anpin commented Dec 27, 2023

Right after I opened issue in the nixos repo, I stopped the manually running instance, closed the shell window and tried to connect somewhere which required to touch the key then notification appeared once, but never again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants