Stop Ctrl-Alt-Delete from rebooting - systemd here we come

General support questions
Post Reply
User avatar
InitOrNot
Posts: 109
Joined: 2015/06/10 18:26:51

Stop Ctrl-Alt-Delete from rebooting - systemd here we come

Post by InitOrNot » 2015/08/29 18:58:42

I'm testing Centos 7 and for the life of me that I cannot get the system to NOT reboot when Ctrl-Alt-Delete is pressed on the console.

In the times of yore, it was enough to edit /etc/inittab and comment the relevant line there.

Now that systemd has taken over, the information about disabling this appears to be behind a paywal in RedHat's support web site: https://access.redhat.com/solutions/1123873

Other information which can be found on the Intertubes talks about running:

Code: Select all

# systemctl mask ctrl-alt-delete.target
# systemctl daemon-reload
However, I run those those commands and still Ctrl-Alt-Delete is rebooting my test system.

Anyone has any insights about that?

User avatar
AlanBartlett
Forum Moderator
Posts: 9319
Joined: 2007/10/22 11:30:09
Location: ~/Earth/UK/England/Suffolk
Contact:

Re: Stop Ctrl-Alt-Delete from rebooting - systemd here we co

Post by AlanBartlett » 2015/08/29 20:23:37

. . . the information about disabling this appears to be behind a paywal in RedHat's support web site: https://access.redhat.com/solutions/1123873
All you need to do is to register and create a Red Hat account for yourself. Here follows the entire contents of the above Knowledge Base Solution --

Issue

* On RHEL7, /etc/init/control-alt-delete.override no more working to override key combination, how to disable the Ctrl-Alt-Del in RHEL7 ?
* How to disable Ctrl-Alt-Del in RHEL7 using GUI ?

Environment

* Red Hat Enterprise Linux 7
* systemd

Resolution

If requirement is to disable the ctrl + Alt + delete key combination, one need to mask a service. This is like disabling a service,

Run the following command:

# ln -sf /dev/null /etc/systemd/system/ctrl-alt-del.target

or

# systemctl mask ctrl-alt-del.target

NOTE: systemd will recognize units symlinked to /dev/null and show them as masked. If one try to send key combination, this will fail with following similar error.

Jul 9 02:33:43 rhel7test systemd: Failed to enqueue ctrl-alt-del.target job: Unit ctrl-alt-del.target is masked.

* However above steps will not disable ctrl + Alt + delete key combination, in GUI mode. To disable it in GUI change keyboard settings.

Navigate to Applications -> System Tools -> Settings -> Keyboard -> Shortcuts -> System
Set value of `Logout` as Disabled
Image 100% Linux and, previously, Unix. Co-founder of the ELRepo Project.

User avatar
TrevorH
Forum Moderator
Posts: 23496
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Stop Ctrl-Alt-Delete from rebooting - systemd here we co

Post by TrevorH » 2015/08/29 21:38:34

All you need to do is to register and create a Red Hat account for yourself.
Sorry, this does not work. What I get when I sign in is
A subscription is required for full access to the Red Hat Knowledgebase.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

User avatar
InitOrNot
Posts: 109
Joined: 2015/06/10 18:26:51

Re: Stop Ctrl-Alt-Delete from rebooting - systemd here we co

Post by InitOrNot » 2015/08/30 00:20:27

Thank you, AlanBartlett.

I can confirm these two command work fine disabling the Ctrl-Alt-Delete combo:

Code: Select all

systemctl mask ctrl-alt-del.target
systemctl daemon-reload
So there was a typo in the instructions about it in the (open access) github.com web page, and the restricted access RedHat page had the right information.

Systemd proponents claim it's documentation is great. Does anyone know whether this is documented in the systemd official documentation (source code is not documentation)?

Post Reply