I am using keyfuzz to map Alt-Eject to Alt-SysRq in Mac keyboard (See here). But on recent (X)ubuntus it is preferred to use systemd service to run the needed command at startup. I wonder how early I can put that service to be executed? Like which WantedBy=
, After=
, Before=
and such attributes to use so that the configuration works and will not be overwritten? Will it work even in rescue mode boot then?
here is some reference about dependencies between different targets.
Edit: I put WantedBy=multi-user.target friendly-recovery.target
in [Install]
section of the .service file I created. That seems to work also in recovery mode root shell.
udevd
. However, instead of relying on a device (e.g. keyboard) being present at a specific target, I'd hook intoudev
so you can do something as soon as the device is attached. For remapping scancode->keycode, you can simply use a Hardware Database (hwdb) entry (which will also work in rescue mode). Take a look at/lib/udev/hwdb.d/60-keyboard.hwdb
for some usage examples. – danzel Aug 30 '19 at 11:46