How to reboot a locked up local or remote Linux box

On the odd occasion your Linux box will lock up and won't appear to be working, at this point you go darn I'd love to do a controlled shutdown. The machine may look like its locked up but the good old Linux kernel may still be available to run some commands and shut the machine down cleanly. In the remote server situation this sure beats organizing someone to go and shut the machine down for you.

To shut the machine down you need to run some magic system commands on the machine or remotely via telnet, a full set of commands can be found at Magic SysReq key wiki.

As an example to run these commands remotely you could do the following :-

Show Plain Text
Text code
  1. // Telnet to the machine
  2. telnet <your-machine-ip> 4094
  3. // Enter root password and at sysrq> prompt enter
  4. s<return>
  5. // To sync drives, then enter
  6. b<return>
  7. // To reboot, there will be no prompt returned from this command, so simply ^] then quit to exit from the Telnet

A colleague came across this functionality in the Linux kernel, just brilliant! Simply a must have for those remotely administering Linux servers.

Filed under: Linux  Tags: Debian, Ubuntu

0 Responses to “How to reboot a locked up local or remote Linux box”

Sorry, comments have been closed for this post.
(default) 11 queries took 8 ms
NrQueryErrorAffectedNum. rowsTook (ms)
1DESCRIBE `posts`17171
2DESCRIBE `comments`11111
3DESCRIBE `tags`221
4DESCRIBE `categories`221
5DESCRIBE `posts_tags`221
6DESCRIBE `categories_posts`221
7SELECT `Post`.`id`, `Post`.`url`, `Post`.`title`, `Post`.`icon`, `Post`.`metadesc`, `Post`.`metakeys`, `Post`.`categories`, `Post`.`tease`, `Post`.`body`, `Post`.`private_body`, `Post`.`created`, `Post`.`modified`, `Post`.`status`, `Post`.`allow_comments`, `Post`.`tags`, `Post`.`hitcount`, `Post`.`hitcount_rss` FROM `posts` AS `Post` WHERE `Post`.`url` = 'how-to-reboot-a-locked-up-local-or-remote-linux-box' LIMIT 1111
8SELECT `Comment`.`id`, `Comment`.`post_id`, `Comment`.`body`, `Comment`.`author`, `Comment`.`url`, `Comment`.`email`, `Comment`.`ip`, `Comment`.`status`, `Comment`.`junk_score`, `Comment`.`created`, `Comment`.`modified` FROM `comments` AS `Comment` WHERE `Comment`.`status` = 2 AND `Comment`.`post_id` = (68) 001
9SELECT `Tag`.`id`, `Tag`.`tag`, `PostsTag`.`post_id`, `PostsTag`.`tag_id` FROM `tags` AS `Tag` JOIN `posts_tags` AS `PostsTag` ON (`PostsTag`.`post_id` = 68 AND `PostsTag`.`tag_id` = `Tag`.`id`) 220
10SELECT `Category`.`id`, `Category`.`category`, `CategoriesPost`.`post_id`, `CategoriesPost`.`category_id` FROM `categories` AS `Category` JOIN `categories_posts` AS `CategoriesPost` ON (`CategoriesPost`.`post_id` = 68 AND `CategoriesPost`.`category_id` = `Category`.`id`) 110
11UPDATE `posts` AS `Post` SET `Post`.`hitcount` = Post.hitcount + 1 WHERE `Post`.`id` = 6810