SysRq (Magic SysRq key)

Likely not the case.

Well, ultimately all handling of all devices including keyboard and all keys is handled by the kernel but that answers very little without knowing how the kernel handles and/or forwards these tasks.

/lib/systemd/system/console-getty.service uses agetty, not getty. May or may not be an irrelevant detail, didn’t research the difference.

If you are in X, run sudo journalctl -f and press ctrl + alt + F2 and switch back to X, you will see the following in the log:

Aug 22 18:30:48 dom0 systemd[1]: Started Getty on tty2.
Aug 22 18:30:48 dom0 audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=getty@tty2 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Aug 22 18:30:48 dom0 kernel: audit: type=1130 audit(1566513048.972:200): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=getty@tty2 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'

This means as long as no virtual console is being switched to, no getty is ruining. This can be confirmed using sudo ps aux too. Nowadays there are no needless processes running all the time. Therefore it cannot be getty or agetty listening for ctrl + alt + F1. systemd starts agetty (probably, even though log says getty), looks like.

It might be systemd that intercepts ctrl + alt + F1. Or it could be the kernel which then notifies systemd. But we still don’t know if X could hook/intercept ctrl + alt + F1 since obviously X also knows what’s happening on the keyboard.

1 Like