Does Linux have a Ctrl+Alt+Del equivalent?
up vote
15
down vote
favorite
Does Linux have a CTRL+ALT+DEL equivalent?
linux ctrl-alt-delete
migrated from stackoverflow.com Sep 28 '10 at 13:57
This question came from our site for professional and enthusiast programmers.
add a comment |
up vote
15
down vote
favorite
Does Linux have a CTRL+ALT+DEL equivalent?
linux ctrl-alt-delete
migrated from stackoverflow.com Sep 28 '10 at 13:57
This question came from our site for professional and enthusiast programmers.
3
CTRL+ALT+DEL can do many things on Windows? Are you looking for a process manager?
– BloodPhilia
Sep 28 '10 at 14:00
This varies a great deal by what kind of system you are using. What distribution/desktop environment/window manager do you use?
– Daenyth
Sep 28 '10 at 14:19
add a comment |
up vote
15
down vote
favorite
up vote
15
down vote
favorite
Does Linux have a CTRL+ALT+DEL equivalent?
linux ctrl-alt-delete
Does Linux have a CTRL+ALT+DEL equivalent?
linux ctrl-alt-delete
linux ctrl-alt-delete
edited May 20 at 14:52
Ciro Santilli 新疆改造中心 六四事件 法轮功
3,83622734
3,83622734
asked Sep 28 '10 at 13:51
gutsygecko
76114
76114
migrated from stackoverflow.com Sep 28 '10 at 13:57
This question came from our site for professional and enthusiast programmers.
migrated from stackoverflow.com Sep 28 '10 at 13:57
This question came from our site for professional and enthusiast programmers.
3
CTRL+ALT+DEL can do many things on Windows? Are you looking for a process manager?
– BloodPhilia
Sep 28 '10 at 14:00
This varies a great deal by what kind of system you are using. What distribution/desktop environment/window manager do you use?
– Daenyth
Sep 28 '10 at 14:19
add a comment |
3
CTRL+ALT+DEL can do many things on Windows? Are you looking for a process manager?
– BloodPhilia
Sep 28 '10 at 14:00
This varies a great deal by what kind of system you are using. What distribution/desktop environment/window manager do you use?
– Daenyth
Sep 28 '10 at 14:19
3
3
CTRL+ALT+DEL can do many things on Windows? Are you looking for a process manager?
– BloodPhilia
Sep 28 '10 at 14:00
CTRL+ALT+DEL can do many things on Windows? Are you looking for a process manager?
– BloodPhilia
Sep 28 '10 at 14:00
This varies a great deal by what kind of system you are using. What distribution/desktop environment/window manager do you use?
– Daenyth
Sep 28 '10 at 14:19
This varies a great deal by what kind of system you are using. What distribution/desktop environment/window manager do you use?
– Daenyth
Sep 28 '10 at 14:19
add a comment |
9 Answers
9
active
oldest
votes
up vote
15
down vote
X can be killed using Ctrl+Alt+BackSpace, and if you hit Ctrl+Alt+F1 (or F2 through 6), you'll be dropped to a virtual console where you can type commands to kill the bad app. To switch back to the GUI, hit Ctrl+Alt+F7.
Might need to hit Alt+SysRq+R before you can use Ctrl+Alt+F1, if the keyboard is stuck in some strange mode.
– Eroen
Mar 30 '12 at 15:44
add a comment |
up vote
9
down vote
Under GNU/Linux [at least those based on the SystemV init style], the behavior of ctrl+alt+del relies on the configuration file /etc/inittab
where you should be able to read a line like:
<id>::ctrlaltdel:/sbin/shutdown -t3 -r now
(example from an ArchLinux distribution) which means that the system will be shutdown when it receives the key combination. But you may want to do something else, like*:
<id>::ctrlaltdel:/usb/bin/sudo make me a sandwich
(which is much more useful :)
4
make: *** No rule to make target `me'. Stop.
– Eroen
Mar 30 '12 at 15:47
add a comment |
up vote
5
down vote
Well you can create shortcut for Alt+Ctrl+Del in Linux, but there is some other more interesting combinations that you might like to know.
Holding down Alt and SysRq (which is the Print Screen key) while slowly typing REISUB will get you safely restarted. REISUO will do a shutdown rather than a restart. See REISUB - the gentle Linux restart for more details.
And you might already know this but press Alt + Ctrl + any of the keys from F1 to F6 to get a console at any time, which you can use to login in text mode and use command line. This was very helpful when I messed my desktop environment.
add a comment |
up vote
3
down vote
In the Linux console, by default in most distributions, Ctrl+Alt+Del behaves as in the MS-DOS - it restarts the system.
In the GUI, Ctrl+Alt+Backspace will kill the current X server and start a new one, thus behaving like the SAK sequence in Windows (Ctrl+Alt+Del).
add a comment |
up vote
2
down vote
Yes, however the action it takes depends on desktop manager configurations. In KDE it shows a dialog for which you can choose if restart or halt the system.
add a comment |
up vote
1
down vote
REISUB would be the closest equivalent. Magic SysRq keys are the only way of emulating traditional Windows / DOS hard-resets in Linux / UNIX.
For a Program Manager-like interface, use top and hit 'k' for 'k'ill.
Ctrl+Alt+Backspace is disabled by default in X Servers > 1.6 (although some distros re-enable it in the config files that they ship). Although it doesn't do what Windows Ctrl+Alt+Del does in general killing X and fixing misbehaving programs is preferred over restarting the machine.
+1 for magic SysRq-keys. They have been handy many times in the past.
– Daniel Andersson
Mar 30 '12 at 17:50
add a comment |
up vote
0
down vote
In gnome, there's a feature called "Keyboard Shortcuts" that lets you customize keyboard shortcuts.
The process manager for Gnome is called gnome-system-monitor, so if you go to:
- System;
- Preferences;
- Keyboard Shortcuts and add gnome-system-monitor as CTRL+ALT+DEL it should work for you :)
add a comment |
up vote
0
down vote
Yes, they are the same keys as on Ubuntu but they may vary according to your distribution.
That's not true. This will mostly reboot the window manager, not open up a task manager.
– slhck
Jul 18 '12 at 0:50
add a comment |
up vote
0
down vote
The Linux kernel can either hard reboot or send SIGINT the init process upon Ctrl + Alt + Del
Therefore, if the SIGINT behaviour is enabled, then you can make Ctrl + Alt + Del do whatever your init wants it to do.
The Linux kernel itself allows two possible behaviors from Ctrl+Alt+Del:
- reboot immediately
- send SIGINT to the init process
Which behavior is used can be selected with either:
reboot
system call, seeman 2 reboot
/proc/sys/kernel/ctrl-alt-del
For example, BusyBox' 1.28.3 init execs an arbitrary command given in /etc/inittab
as:
::ctrlaltdel:/sbin/reboot
And here is a minimal interesting C example for uclibc:
#define _XOPEN_SOURCE 700
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/reboot.h>
#include <unistd.h>
void signal_handler(int sig) {
write(STDOUT_FILENO, "cadn", 4);
signal(sig, signal_handler);
}
int main(void) {
int i = 0;
/* Disable the forced reboot, enable sending SIGINT to init. */
reboot(RB_DISABLE_CAD);
signal(SIGINT, signal_handler);
while (1) {
sleep(1);
printf("%dn", i);
i++;
}
return EXIT_SUCCESS;
}
Here is an easy setup to try this out.
add a comment |
9 Answers
9
active
oldest
votes
9 Answers
9
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
15
down vote
X can be killed using Ctrl+Alt+BackSpace, and if you hit Ctrl+Alt+F1 (or F2 through 6), you'll be dropped to a virtual console where you can type commands to kill the bad app. To switch back to the GUI, hit Ctrl+Alt+F7.
Might need to hit Alt+SysRq+R before you can use Ctrl+Alt+F1, if the keyboard is stuck in some strange mode.
– Eroen
Mar 30 '12 at 15:44
add a comment |
up vote
15
down vote
X can be killed using Ctrl+Alt+BackSpace, and if you hit Ctrl+Alt+F1 (or F2 through 6), you'll be dropped to a virtual console where you can type commands to kill the bad app. To switch back to the GUI, hit Ctrl+Alt+F7.
Might need to hit Alt+SysRq+R before you can use Ctrl+Alt+F1, if the keyboard is stuck in some strange mode.
– Eroen
Mar 30 '12 at 15:44
add a comment |
up vote
15
down vote
up vote
15
down vote
X can be killed using Ctrl+Alt+BackSpace, and if you hit Ctrl+Alt+F1 (or F2 through 6), you'll be dropped to a virtual console where you can type commands to kill the bad app. To switch back to the GUI, hit Ctrl+Alt+F7.
X can be killed using Ctrl+Alt+BackSpace, and if you hit Ctrl+Alt+F1 (or F2 through 6), you'll be dropped to a virtual console where you can type commands to kill the bad app. To switch back to the GUI, hit Ctrl+Alt+F7.
edited Mar 24 '16 at 6:55
phuclv
8,78563688
8,78563688
answered Sep 28 '10 at 13:54
Thariama
6991621
6991621
Might need to hit Alt+SysRq+R before you can use Ctrl+Alt+F1, if the keyboard is stuck in some strange mode.
– Eroen
Mar 30 '12 at 15:44
add a comment |
Might need to hit Alt+SysRq+R before you can use Ctrl+Alt+F1, if the keyboard is stuck in some strange mode.
– Eroen
Mar 30 '12 at 15:44
Might need to hit Alt+SysRq+R before you can use Ctrl+Alt+F1, if the keyboard is stuck in some strange mode.
– Eroen
Mar 30 '12 at 15:44
Might need to hit Alt+SysRq+R before you can use Ctrl+Alt+F1, if the keyboard is stuck in some strange mode.
– Eroen
Mar 30 '12 at 15:44
add a comment |
up vote
9
down vote
Under GNU/Linux [at least those based on the SystemV init style], the behavior of ctrl+alt+del relies on the configuration file /etc/inittab
where you should be able to read a line like:
<id>::ctrlaltdel:/sbin/shutdown -t3 -r now
(example from an ArchLinux distribution) which means that the system will be shutdown when it receives the key combination. But you may want to do something else, like*:
<id>::ctrlaltdel:/usb/bin/sudo make me a sandwich
(which is much more useful :)
4
make: *** No rule to make target `me'. Stop.
– Eroen
Mar 30 '12 at 15:47
add a comment |
up vote
9
down vote
Under GNU/Linux [at least those based on the SystemV init style], the behavior of ctrl+alt+del relies on the configuration file /etc/inittab
where you should be able to read a line like:
<id>::ctrlaltdel:/sbin/shutdown -t3 -r now
(example from an ArchLinux distribution) which means that the system will be shutdown when it receives the key combination. But you may want to do something else, like*:
<id>::ctrlaltdel:/usb/bin/sudo make me a sandwich
(which is much more useful :)
4
make: *** No rule to make target `me'. Stop.
– Eroen
Mar 30 '12 at 15:47
add a comment |
up vote
9
down vote
up vote
9
down vote
Under GNU/Linux [at least those based on the SystemV init style], the behavior of ctrl+alt+del relies on the configuration file /etc/inittab
where you should be able to read a line like:
<id>::ctrlaltdel:/sbin/shutdown -t3 -r now
(example from an ArchLinux distribution) which means that the system will be shutdown when it receives the key combination. But you may want to do something else, like*:
<id>::ctrlaltdel:/usb/bin/sudo make me a sandwich
(which is much more useful :)
Under GNU/Linux [at least those based on the SystemV init style], the behavior of ctrl+alt+del relies on the configuration file /etc/inittab
where you should be able to read a line like:
<id>::ctrlaltdel:/sbin/shutdown -t3 -r now
(example from an ArchLinux distribution) which means that the system will be shutdown when it receives the key combination. But you may want to do something else, like*:
<id>::ctrlaltdel:/usb/bin/sudo make me a sandwich
(which is much more useful :)
answered Mar 12 '11 at 8:50
Kevin
2791412
2791412
4
make: *** No rule to make target `me'. Stop.
– Eroen
Mar 30 '12 at 15:47
add a comment |
4
make: *** No rule to make target `me'. Stop.
– Eroen
Mar 30 '12 at 15:47
4
4
make: *** No rule to make target `me'. Stop.
– Eroen
Mar 30 '12 at 15:47
make: *** No rule to make target `me'. Stop.
– Eroen
Mar 30 '12 at 15:47
add a comment |
up vote
5
down vote
Well you can create shortcut for Alt+Ctrl+Del in Linux, but there is some other more interesting combinations that you might like to know.
Holding down Alt and SysRq (which is the Print Screen key) while slowly typing REISUB will get you safely restarted. REISUO will do a shutdown rather than a restart. See REISUB - the gentle Linux restart for more details.
And you might already know this but press Alt + Ctrl + any of the keys from F1 to F6 to get a console at any time, which you can use to login in text mode and use command line. This was very helpful when I messed my desktop environment.
add a comment |
up vote
5
down vote
Well you can create shortcut for Alt+Ctrl+Del in Linux, but there is some other more interesting combinations that you might like to know.
Holding down Alt and SysRq (which is the Print Screen key) while slowly typing REISUB will get you safely restarted. REISUO will do a shutdown rather than a restart. See REISUB - the gentle Linux restart for more details.
And you might already know this but press Alt + Ctrl + any of the keys from F1 to F6 to get a console at any time, which you can use to login in text mode and use command line. This was very helpful when I messed my desktop environment.
add a comment |
up vote
5
down vote
up vote
5
down vote
Well you can create shortcut for Alt+Ctrl+Del in Linux, but there is some other more interesting combinations that you might like to know.
Holding down Alt and SysRq (which is the Print Screen key) while slowly typing REISUB will get you safely restarted. REISUO will do a shutdown rather than a restart. See REISUB - the gentle Linux restart for more details.
And you might already know this but press Alt + Ctrl + any of the keys from F1 to F6 to get a console at any time, which you can use to login in text mode and use command line. This was very helpful when I messed my desktop environment.
Well you can create shortcut for Alt+Ctrl+Del in Linux, but there is some other more interesting combinations that you might like to know.
Holding down Alt and SysRq (which is the Print Screen key) while slowly typing REISUB will get you safely restarted. REISUO will do a shutdown rather than a restart. See REISUB - the gentle Linux restart for more details.
And you might already know this but press Alt + Ctrl + any of the keys from F1 to F6 to get a console at any time, which you can use to login in text mode and use command line. This was very helpful when I messed my desktop environment.
edited Sep 2 '16 at 10:06
naXa
1176
1176
answered Oct 18 '13 at 5:59
Thomas
2671412
2671412
add a comment |
add a comment |
up vote
3
down vote
In the Linux console, by default in most distributions, Ctrl+Alt+Del behaves as in the MS-DOS - it restarts the system.
In the GUI, Ctrl+Alt+Backspace will kill the current X server and start a new one, thus behaving like the SAK sequence in Windows (Ctrl+Alt+Del).
add a comment |
up vote
3
down vote
In the Linux console, by default in most distributions, Ctrl+Alt+Del behaves as in the MS-DOS - it restarts the system.
In the GUI, Ctrl+Alt+Backspace will kill the current X server and start a new one, thus behaving like the SAK sequence in Windows (Ctrl+Alt+Del).
add a comment |
up vote
3
down vote
up vote
3
down vote
In the Linux console, by default in most distributions, Ctrl+Alt+Del behaves as in the MS-DOS - it restarts the system.
In the GUI, Ctrl+Alt+Backspace will kill the current X server and start a new one, thus behaving like the SAK sequence in Windows (Ctrl+Alt+Del).
In the Linux console, by default in most distributions, Ctrl+Alt+Del behaves as in the MS-DOS - it restarts the system.
In the GUI, Ctrl+Alt+Backspace will kill the current X server and start a new one, thus behaving like the SAK sequence in Windows (Ctrl+Alt+Del).
edited Mar 15 '12 at 13:26
Diogo
21.8k54132209
21.8k54132209
answered Sep 28 '10 at 13:56
florin
668157
668157
add a comment |
add a comment |
up vote
2
down vote
Yes, however the action it takes depends on desktop manager configurations. In KDE it shows a dialog for which you can choose if restart or halt the system.
add a comment |
up vote
2
down vote
Yes, however the action it takes depends on desktop manager configurations. In KDE it shows a dialog for which you can choose if restart or halt the system.
add a comment |
up vote
2
down vote
up vote
2
down vote
Yes, however the action it takes depends on desktop manager configurations. In KDE it shows a dialog for which you can choose if restart or halt the system.
Yes, however the action it takes depends on desktop manager configurations. In KDE it shows a dialog for which you can choose if restart or halt the system.
answered Sep 28 '10 at 13:56
xdevel2000
13927
13927
add a comment |
add a comment |
up vote
1
down vote
REISUB would be the closest equivalent. Magic SysRq keys are the only way of emulating traditional Windows / DOS hard-resets in Linux / UNIX.
For a Program Manager-like interface, use top and hit 'k' for 'k'ill.
Ctrl+Alt+Backspace is disabled by default in X Servers > 1.6 (although some distros re-enable it in the config files that they ship). Although it doesn't do what Windows Ctrl+Alt+Del does in general killing X and fixing misbehaving programs is preferred over restarting the machine.
+1 for magic SysRq-keys. They have been handy many times in the past.
– Daniel Andersson
Mar 30 '12 at 17:50
add a comment |
up vote
1
down vote
REISUB would be the closest equivalent. Magic SysRq keys are the only way of emulating traditional Windows / DOS hard-resets in Linux / UNIX.
For a Program Manager-like interface, use top and hit 'k' for 'k'ill.
Ctrl+Alt+Backspace is disabled by default in X Servers > 1.6 (although some distros re-enable it in the config files that they ship). Although it doesn't do what Windows Ctrl+Alt+Del does in general killing X and fixing misbehaving programs is preferred over restarting the machine.
+1 for magic SysRq-keys. They have been handy many times in the past.
– Daniel Andersson
Mar 30 '12 at 17:50
add a comment |
up vote
1
down vote
up vote
1
down vote
REISUB would be the closest equivalent. Magic SysRq keys are the only way of emulating traditional Windows / DOS hard-resets in Linux / UNIX.
For a Program Manager-like interface, use top and hit 'k' for 'k'ill.
Ctrl+Alt+Backspace is disabled by default in X Servers > 1.6 (although some distros re-enable it in the config files that they ship). Although it doesn't do what Windows Ctrl+Alt+Del does in general killing X and fixing misbehaving programs is preferred over restarting the machine.
REISUB would be the closest equivalent. Magic SysRq keys are the only way of emulating traditional Windows / DOS hard-resets in Linux / UNIX.
For a Program Manager-like interface, use top and hit 'k' for 'k'ill.
Ctrl+Alt+Backspace is disabled by default in X Servers > 1.6 (although some distros re-enable it in the config files that they ship). Although it doesn't do what Windows Ctrl+Alt+Del does in general killing X and fixing misbehaving programs is preferred over restarting the machine.
edited Mar 30 '12 at 15:19
answered Sep 28 '10 at 14:03
James Broadhead
1747
1747
+1 for magic SysRq-keys. They have been handy many times in the past.
– Daniel Andersson
Mar 30 '12 at 17:50
add a comment |
+1 for magic SysRq-keys. They have been handy many times in the past.
– Daniel Andersson
Mar 30 '12 at 17:50
+1 for magic SysRq-keys. They have been handy many times in the past.
– Daniel Andersson
Mar 30 '12 at 17:50
+1 for magic SysRq-keys. They have been handy many times in the past.
– Daniel Andersson
Mar 30 '12 at 17:50
add a comment |
up vote
0
down vote
In gnome, there's a feature called "Keyboard Shortcuts" that lets you customize keyboard shortcuts.
The process manager for Gnome is called gnome-system-monitor, so if you go to:
- System;
- Preferences;
- Keyboard Shortcuts and add gnome-system-monitor as CTRL+ALT+DEL it should work for you :)
add a comment |
up vote
0
down vote
In gnome, there's a feature called "Keyboard Shortcuts" that lets you customize keyboard shortcuts.
The process manager for Gnome is called gnome-system-monitor, so if you go to:
- System;
- Preferences;
- Keyboard Shortcuts and add gnome-system-monitor as CTRL+ALT+DEL it should work for you :)
add a comment |
up vote
0
down vote
up vote
0
down vote
In gnome, there's a feature called "Keyboard Shortcuts" that lets you customize keyboard shortcuts.
The process manager for Gnome is called gnome-system-monitor, so if you go to:
- System;
- Preferences;
- Keyboard Shortcuts and add gnome-system-monitor as CTRL+ALT+DEL it should work for you :)
In gnome, there's a feature called "Keyboard Shortcuts" that lets you customize keyboard shortcuts.
The process manager for Gnome is called gnome-system-monitor, so if you go to:
- System;
- Preferences;
- Keyboard Shortcuts and add gnome-system-monitor as CTRL+ALT+DEL it should work for you :)
edited Mar 15 '12 at 13:18
Diogo
21.8k54132209
21.8k54132209
answered Sep 28 '10 at 14:07
Azz
3,2272022
3,2272022
add a comment |
add a comment |
up vote
0
down vote
Yes, they are the same keys as on Ubuntu but they may vary according to your distribution.
That's not true. This will mostly reboot the window manager, not open up a task manager.
– slhck
Jul 18 '12 at 0:50
add a comment |
up vote
0
down vote
Yes, they are the same keys as on Ubuntu but they may vary according to your distribution.
That's not true. This will mostly reboot the window manager, not open up a task manager.
– slhck
Jul 18 '12 at 0:50
add a comment |
up vote
0
down vote
up vote
0
down vote
Yes, they are the same keys as on Ubuntu but they may vary according to your distribution.
Yes, they are the same keys as on Ubuntu but they may vary according to your distribution.
edited Jul 18 '12 at 22:26
Tom Wijsman
49.9k23163244
49.9k23163244
answered Sep 28 '10 at 13:54
karlphillip
8961816
8961816
That's not true. This will mostly reboot the window manager, not open up a task manager.
– slhck
Jul 18 '12 at 0:50
add a comment |
That's not true. This will mostly reboot the window manager, not open up a task manager.
– slhck
Jul 18 '12 at 0:50
That's not true. This will mostly reboot the window manager, not open up a task manager.
– slhck
Jul 18 '12 at 0:50
That's not true. This will mostly reboot the window manager, not open up a task manager.
– slhck
Jul 18 '12 at 0:50
add a comment |
up vote
0
down vote
The Linux kernel can either hard reboot or send SIGINT the init process upon Ctrl + Alt + Del
Therefore, if the SIGINT behaviour is enabled, then you can make Ctrl + Alt + Del do whatever your init wants it to do.
The Linux kernel itself allows two possible behaviors from Ctrl+Alt+Del:
- reboot immediately
- send SIGINT to the init process
Which behavior is used can be selected with either:
reboot
system call, seeman 2 reboot
/proc/sys/kernel/ctrl-alt-del
For example, BusyBox' 1.28.3 init execs an arbitrary command given in /etc/inittab
as:
::ctrlaltdel:/sbin/reboot
And here is a minimal interesting C example for uclibc:
#define _XOPEN_SOURCE 700
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/reboot.h>
#include <unistd.h>
void signal_handler(int sig) {
write(STDOUT_FILENO, "cadn", 4);
signal(sig, signal_handler);
}
int main(void) {
int i = 0;
/* Disable the forced reboot, enable sending SIGINT to init. */
reboot(RB_DISABLE_CAD);
signal(SIGINT, signal_handler);
while (1) {
sleep(1);
printf("%dn", i);
i++;
}
return EXIT_SUCCESS;
}
Here is an easy setup to try this out.
add a comment |
up vote
0
down vote
The Linux kernel can either hard reboot or send SIGINT the init process upon Ctrl + Alt + Del
Therefore, if the SIGINT behaviour is enabled, then you can make Ctrl + Alt + Del do whatever your init wants it to do.
The Linux kernel itself allows two possible behaviors from Ctrl+Alt+Del:
- reboot immediately
- send SIGINT to the init process
Which behavior is used can be selected with either:
reboot
system call, seeman 2 reboot
/proc/sys/kernel/ctrl-alt-del
For example, BusyBox' 1.28.3 init execs an arbitrary command given in /etc/inittab
as:
::ctrlaltdel:/sbin/reboot
And here is a minimal interesting C example for uclibc:
#define _XOPEN_SOURCE 700
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/reboot.h>
#include <unistd.h>
void signal_handler(int sig) {
write(STDOUT_FILENO, "cadn", 4);
signal(sig, signal_handler);
}
int main(void) {
int i = 0;
/* Disable the forced reboot, enable sending SIGINT to init. */
reboot(RB_DISABLE_CAD);
signal(SIGINT, signal_handler);
while (1) {
sleep(1);
printf("%dn", i);
i++;
}
return EXIT_SUCCESS;
}
Here is an easy setup to try this out.
add a comment |
up vote
0
down vote
up vote
0
down vote
The Linux kernel can either hard reboot or send SIGINT the init process upon Ctrl + Alt + Del
Therefore, if the SIGINT behaviour is enabled, then you can make Ctrl + Alt + Del do whatever your init wants it to do.
The Linux kernel itself allows two possible behaviors from Ctrl+Alt+Del:
- reboot immediately
- send SIGINT to the init process
Which behavior is used can be selected with either:
reboot
system call, seeman 2 reboot
/proc/sys/kernel/ctrl-alt-del
For example, BusyBox' 1.28.3 init execs an arbitrary command given in /etc/inittab
as:
::ctrlaltdel:/sbin/reboot
And here is a minimal interesting C example for uclibc:
#define _XOPEN_SOURCE 700
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/reboot.h>
#include <unistd.h>
void signal_handler(int sig) {
write(STDOUT_FILENO, "cadn", 4);
signal(sig, signal_handler);
}
int main(void) {
int i = 0;
/* Disable the forced reboot, enable sending SIGINT to init. */
reboot(RB_DISABLE_CAD);
signal(SIGINT, signal_handler);
while (1) {
sleep(1);
printf("%dn", i);
i++;
}
return EXIT_SUCCESS;
}
Here is an easy setup to try this out.
The Linux kernel can either hard reboot or send SIGINT the init process upon Ctrl + Alt + Del
Therefore, if the SIGINT behaviour is enabled, then you can make Ctrl + Alt + Del do whatever your init wants it to do.
The Linux kernel itself allows two possible behaviors from Ctrl+Alt+Del:
- reboot immediately
- send SIGINT to the init process
Which behavior is used can be selected with either:
reboot
system call, seeman 2 reboot
/proc/sys/kernel/ctrl-alt-del
For example, BusyBox' 1.28.3 init execs an arbitrary command given in /etc/inittab
as:
::ctrlaltdel:/sbin/reboot
And here is a minimal interesting C example for uclibc:
#define _XOPEN_SOURCE 700
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/reboot.h>
#include <unistd.h>
void signal_handler(int sig) {
write(STDOUT_FILENO, "cadn", 4);
signal(sig, signal_handler);
}
int main(void) {
int i = 0;
/* Disable the forced reboot, enable sending SIGINT to init. */
reboot(RB_DISABLE_CAD);
signal(SIGINT, signal_handler);
while (1) {
sleep(1);
printf("%dn", i);
i++;
}
return EXIT_SUCCESS;
}
Here is an easy setup to try this out.
edited Nov 19 at 13:56
naXa
1176
1176
answered May 20 at 14:52
Ciro Santilli 新疆改造中心 六四事件 法轮功
3,83622734
3,83622734
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f193652%2fdoes-linux-have-a-ctrlaltdel-equivalent%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
3
CTRL+ALT+DEL can do many things on Windows? Are you looking for a process manager?
– BloodPhilia
Sep 28 '10 at 14:00
This varies a great deal by what kind of system you are using. What distribution/desktop environment/window manager do you use?
– Daenyth
Sep 28 '10 at 14:19