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
Keyboard does not work when runing keyd as a runit service on Void Linux #263
Comments
Does this problem occur if you manually restart keyd in a tty before starting your window manager? By 'not work' do you mean your keyboard is entirely unresponsive, or simply that it doesn't have your modified bindings? It is possible that the service is being initialized before your file system has fully loaded (meaning it won't have access to |
They keyboard is not responsive and i have to shutdown using the power button. It probably is a problem of timing. I disabled the service and now i start when i enter the graphical environment and everything is working flawlessly |
This sounds like a distro specific init issue. Can you post the keyd log output from the problematic initialization? I assume there is some way to recover it from runit, though I am unfamiliar with it. |
Weird. I reverted back to using the runit service and the problem is gone. I'll use a few more days and report back if anything happens again. If not, i'll close the issue. |
I have a similar problem on Void Linux when i start it using runit. It seems to capture all keyboard input when the X server starts up. When I use the escape sequence, keyd restarts and then it's all good. i can login and the mapping works. |
In case you would like to investigate further: Are you using eudev (the default) or did you replace it with libudev-zero This sometimes confuses libinput and causes issues with device hotplugging, so it could be that keyd's virtual keyboard is not properly picked up by wayland/x11. To avoid having to install a syslog, you could temporarily redirect keyd's STDOUT and STDERR to some file by adapting In general, runit unfortunately lacks proper service supervision capabilities as touched upon for example here. In particular, it has no builtin dependency management. However, there is an ongoing and long awaited project which will fill this gap. |
The problem came back and looking at log files, it does not seem to show anything. Here is what i found in svlogtail: |
I spent some time digging into this, and it looks like it is indeed related to initialization order. From what I understand, void initializes udev twice (for reasons I don't fully understand), once as a core service and then again as a system service. The system service kills the original instance and then starts a new one, creating a gap in which udev is not actively monitoring kernel events. It seems keyd is started between the first and second udev instances which prevents eudev from responding to the kernel event and creating a database entry. This subsequently causes libinput/X not to identify it as an input device. If my understanding is correct, this should probably be regarded as a void bug, but it is possible I have misunderstood something. In the meantime the solution is to add a timeout to the keyd runit service E.G: /etc/sv/keyd/run:
or else to simply disable the system udev service ( If someone with a better grasp of void internals could corroborate this or offer corrections, it would be greatly appreciated. |
As I understand it, their core service mechanism is primarily there to start one shot services, which are not properly supported by runit (termination of a service is interpreted as service failure if I'm not mistaken, so runit would try to start the service again, resulting in an infinite loop in the case of one shots or forking services). They however need udev at that stage for some core service scripts called later. The second call as a system service is then needed so that udev is monitored by runit (and can for example be cleanly terminated on system shut down).
This should exactly be the issue here.
While this should very likely fix the problem most of the time, it technically still does not guarantee proper startup in all cases. The safest route here is to check whether the “right” (i.e. system service) udev is running, using a combination of runit's For the same reason, this issue can be closed here as keyd itself can't do anything about it. |
This makes sense, though it seems like a bit of a kluge.
Indeed, it was intended as stopgap.
I considered this, but neither will work. The second will produce a false positive before the first instance of udev has terminated and the first will produce a false positive after the init script has been run but before the second instance has been started.
+1. I'm closing this for now. |
^pinging @Barbaross93 who appears to be the void package maintainer. |
Hey @rvaiya, thanks for the ping. I've been having this problem as well and was just using the Regarding your earlier comment:
Por que no los dos? We could do something like:
In this way, we first check to make sure that the |
The problem with that is there is still a window in which the service has started but the old udevd is still running. This may or may not be an issue in practice, but it is still technically a race condition.
You could check if the process exists using something like |
Hmm, I suppose that's true. It's about a one half of a split second wide window with those checks, but it is a window nonetheless. Well, the good news is that So something like this should work:
Obviously it could be cleaner; this is just a quick proof of concept. |
That looks like the ticket. You can use the supervise subdirectory in the service directory to get the pid directly instead of parsing Something like this:
|
I want to post this here being the only Void related matter I could find, is setup the same, meaning create a keyd folder in /etc and putting the config in there? Asking just because I am new to Void Edit Edit 2 |
I'm using Void Linux and autostarting keyd on boot. When i enter sway or river (wayland window managers), my keyboard does not work.
If i start keyd AFTER starting sway or river (with sudo keyd on river init file), it works fine.
The service file on Void Linux (it uses runit instead of systemd) has just 'exec keyd'.
It's keyd v2.4.1
The text was updated successfully, but these errors were encountered: