keyd: Verify current udevd process is supervised by runit

Sometimes when starting the keyd service, the keyboard can become unresponsive.
This is the result of keyd starting when the early udevd process is still
running but before the udevd runit service has started. The udevd runit
service kills the early udevd process causing the keyboard to become
unresponsive until the keyd process has been terminated. The below
code verifies that the supervised udevd process is the same as the
currently running udevd process. Please enter the commit message for
your changes. Lines starting with '#' will be ignored, and an empty
message aborts the commit.
This commit is contained in:
Barbaross 2022-08-04 09:27:43 -04:00 committed by Duncan Overbruck
parent 56dcfc1dea
commit dbc1fb53a3
2 changed files with 10 additions and 1 deletions

View File

@ -1,2 +1,11 @@
#!/bin/sh
# Sometimes when starting the keyd service, the keyboard can become unresponsive.
# This is the result of keyd starting when the early udevd process is still running but
# before the udevd runit service has started. The udevd runit service kills the early udevd
# process causing the keyboard to become unresponsive until the keyd process has been
# terminated. The below code verifies that the supervised udevd process is the same as
# the currently running udevd process.
[ "$(cat /var/service/udevd/supervise/pid)" = "$(pgrep -x udevd)" ] || exit 1
exec keyd

View File

@ -1,7 +1,7 @@
# Template file for 'keyd'
pkgname=keyd
version=2.4.1
revision=1
revision=2
build_style=gnu-makefile
make_use_env=yes
short_desc="Key remapping daemon for linux"