I'm disabling Ctrl-Alt-Del
on a RHEL6 server and enabling Alt-SysRq
.
In the /etc/init/control-alt-delete.conf
file I have commented out the exec /sbin/shutdown -r now "Control-Alt-Delete pressed"
line and replaced it with exec /bin/echo "Control-Alt-Delete has been disabled by the administrator." >/dev/console
.
Unfortunately, this leaves the message hanging on a command prompt instead displaying the message and then dropping to a new prompt. I've tried /bin/echo -e
and added a newline at the end of the string, but that still won't present a new prompt after displaying the message.
I've tried using >&1
to simply send the message to STDOUT, but that does not display anything at all.
A simple solution would be to add text indicating that the user needs to press Enter to return to a prompt, but I'd prefer this happen on its own.
How do I echo a message and then return to a prompt?