CTRL-ALT-DEL not working as expected. Seeking for advices

Denys Vlasenko vda.linux at googlemail.com
Wed Feb 19 16:07:29 UTC 2014


On Wed, Feb 19, 2014 at 3:58 PM, Harald Becker <ralda at gmx.de> wrote:
>>>>Pressing CTRL-ALT-DEL sends SIGINT signal to process 1.
>>>>You want to make sure it reaches it.
>>>
>>> Don't forget to set /proc/sys/kernel/ctrl-alt-del to "0" (zero)
>>> to enable sending SIGINT to the init process.
>>>
>>> e.g.: echo "0" >/proc/sys/kernel/ctrl-alt-del
>>>
>>> Without this most Linux kernel try an immediate reboot without
>>> saving buffers etc., know to fail/hang on some emulators.
>>
>>init.c does that already:
>>
>>                /* Turn off rebooting via CTL-ALT-DEL - we get a
>>                 * SIGINT on CAD so we can shut things down
>> gracefully... */ reboot(RB_DISABLE_CAD); /* misnomer */
>
> Outch! ... if you do this before proc is mounted and system is
> prepared successfully, most emulators fail and many linux systems
> just hang when they receive a ctrl-alt-del.

No. Calling sys_reboot with RB_DISABLE_CAD nee
LINUX_REBOOT_CMD_CAD_OFF nee zero
results in this code executing in kernel:

        case LINUX_REBOOT_CMD_CAD_OFF:
                C_A_D = 0;
                break;

which in turn has this effect on Ctrl-Alt-Del keypress:

void ctrl_alt_del(void)
{
        static DECLARE_WORK(cad_work, deferred_cad);

        if (C_A_D)
                schedule_work(&cad_work);
        else
                kill_cad_pid(SIGINT, 1);
}

- exactly what init wants.


More information about the busybox mailing list