From abd9265d4bbdcfb4eba54aabbf30cab78a0698d4 Mon Sep 17 00:00:00 2001 From: Barbaross Date: Thu, 4 Aug 2022 09:27:43 -0400 Subject: [PATCH] keyd: Verify current udevd process is supervised by runit --- srcpkgs/keyd/files/keyd/run | 9 +++++++++ srcpkgs/keyd/template | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/srcpkgs/keyd/files/keyd/run b/srcpkgs/keyd/files/keyd/run index 868cb747ab6c..5e62cef91c72 100644 --- a/srcpkgs/keyd/files/keyd/run +++ b/srcpkgs/keyd/files/keyd/run @@ -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 diff --git a/srcpkgs/keyd/template b/srcpkgs/keyd/template index 39b6aeaff0ae..b9d4b6aefe24 100644 --- a/srcpkgs/keyd/template +++ b/srcpkgs/keyd/template @@ -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"