sysvinit: Add ability to add default line for ctrl-alt-del

Submitted by Paul Gortmaker on June 6, 2014, 6:41 p.m. | Patch ID: 73453


Message ID
State New
Headers show

Commit Message

Paul Gortmaker June 6, 2014, 6:41 p.m.
Currently the generated inittab doesn't have a line for the three
finger salute, and hence no action is taken on ctrl-alt-del, even
when a normal PC-style target is used with VTs enabled and a real
keyboard connected.

If someone enables USE_VT then lets assume they might actually
intend to use the VTs and connect a keyboard and want ctrl-alt-del
support.  In keeping with the SYSVINIT_ENABLED_GETTYS option, we
make it optional, since for some situations (kiosk etc.) it may
not be desired to be enabled.

Signed-off-by: Paul Gortmaker <>
 meta/conf/documentation.conf                           | 1 +
 meta/recipes-core/sysvinit/ | 7 +++++++
 2 files changed, 8 insertions(+)

Patch hide | download patch | download mbox

diff --git a/meta/conf/documentation.conf b/meta/conf/documentation.conf
index 7fa3f318b959..ba5505790a9e 100644
--- a/meta/conf/documentation.conf
+++ b/meta/conf/documentation.conf
@@ -396,6 +396,7 @@  SYSROOT_PREPROCESS_FUNCS[doc] = "A list of functions to execute after files are
 SYSTEMD_AUTO_ENABLE[doc] = "For recipes that inherit the systemd class, this variable specifies whether the service you have specified in SYSTEMD_SERVICE should be started automatically or not."
 SYSTEMD_PACKAGES[doc] = "For recipes that inherit the systemd class, this variable locates the systemd unit files when they are not found in the main recipe's package."
 SYSTEMD_SERVICE[doc] = "For recipes that inherit the systemd class, this variable specifies the systemd service name for a package."
+SYSVINIT_ENABLED_CTRLALTDEL[doc] = "Specifies if virtual terminals should trap on ctrl-alt-del and reboot, the default is '0'."
 SYSVINIT_ENABLED_GETTYS[doc] = "Specifies which virtual terminals should be running a getty, the default is '1'."
diff --git a/meta/recipes-core/sysvinit/ b/meta/recipes-core/sysvinit/
index c3244b46021e..334f9f1ad4b0 100644
--- a/meta/recipes-core/sysvinit/
+++ b/meta/recipes-core/sysvinit/
@@ -38,6 +38,12 @@  do_install() {
+        if [ "${SYSVINIT_ENABLED_CTRLALTDEL}" = "1" ]; then
+            cat <<EOF >>${D}${sysconfdir}/inittab
+ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
+        fi
         for n in ${SYSVINIT_ENABLED_GETTYS}
@@ -77,6 +83,7 @@  CONFFILES_${PN} = "${sysconfdir}/inittab"
 USE_VT ?= "1"