#!/bin/sh
exec 2>&1

# 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
