[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 356
  • Last Modified:

Send ctrl-alt-del from application

What I want is

echo 1 > /proc/sys/kernel/ctrl-alt-del
send ctrl-alt-del to kernel, so it reboots immediatelly. But how?

Alternativelly, how to reboot machine immediatelly (no sync and stuff). shutdown -rn now fails here(becouse of failed and still mounted disk).
Assume sysrq is not working here...
1 Solution
Why do you think a ctrl-alt-del reboots a Linux box immediatly?
I have no idea how far you got with shutdown -rn. You want to use
shutdown -rf  

and you want to run this command as root.

Duncan RoeSoftware DeveloperCommented:
You could write a small C program to use reboot() (do a "man 2 reboot" for more info). Unless you do a sync() first, it's like throwing the power switch. There is also shutdown -n (DEPRECATED).
If you have a failed and still mounted disk, it would be best to remove it from fstab before rebooting (or at least make it noauto)
ravenplAuthor Commented:
Splendid - thx.

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now