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.