Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 04-29-2007, 10:43 PM   #1
LQ Newbie
Registered: Jun 2006
Posts: 27

Rep: Reputation: 15
reboot command

Hello all. When I type "reboot" at the command prompt in the terminal, does it run some kind of batch file or does it run an executable? Where is this executable located?

Actually, what I'm really interested in is to know what port Linux is writing to to perform the reboot. For example, I know you can write to port 92h, 64h, or cf9h, to do the reboot. I'd like to know which of these linux uses, and if it's possible to change it so that it's using a different port from what it currently uses. For example, if it's using 92h, but I'd like it to use 64h instead, would it be possible to do this?

Thank you.
Old 04-29-2007, 10:56 PM   #2
Junior Hacker
Senior Member
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 61
Where is this executable
Probably /sbin
You can also use command to reboot:
/sbin/shutdown -r now
Or to shutdown:
/sbin/shutdown -h now
Old 04-29-2007, 11:41 PM   #3
LQ Newbie
Registered: Apr 2005
Location: Barbados
Distribution: Mandrake/Mandriva
Posts: 15

Rep: Reputation: 0
At first I thought reboot was an alias to 'shutdown -r now', but I have found, in Mandriva, reboot is located:

Old 04-30-2007, 12:16 AM   #4
LQ Newbie
Registered: Jun 2006
Posts: 27

Original Poster
Rep: Reputation: 15
So I guess in this case reboot is an actual executable program, then? Even so, would it still be possible for me to write my own program to replace this reboot so that it uses the port I want it to use? The programming part of it is probably not too difficult. Pretty much it's just something like "outportb (0x64, 0xfe)" or something like that.

Let's say I write this short program in C and compile it. Is there anything else I have to do other than replace the old reboot with my new one? Or would this require some messing with the kernel or something before I can use my new executable?

Thank you.
Old 04-30-2007, 12:32 AM   #5
Senior Member
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 3,031

Rep: Reputation: 539Reputation: 539Reputation: 539Reputation: 539Reputation: 539Reputation: 539
Reboot is run level 6, so:

Init 6 essentially does:


and changes the run level to 6.

If your looking for files, try udatedb as root, and then locate <file>.
Old 04-30-2007, 05:15 PM   #6
LQ Newbie
Registered: Jun 2006
Posts: 27

Original Poster
Rep: Reputation: 15
Thank you. I've also found out that the the reboot is using some system services that's supposed to put the system in the right state before rebooting. So I guess I can't just write a small program like I wanted to do to replace the old reboot.


reboot, shutdown

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
reboot command at selected O.S. raven4d Linux - Software 2 03-20-2006 05:15 AM
reboot when "reboot" command not responding? neocookie Linux - General 1 08-30-2005 04:59 AM
rename reboot command coco03 Linux - General 6 04-19-2005 02:11 AM
problem with reboot command Belkorin Fedora 0 07-09-2004 10:59 AM
command to reboot linux klintonray Linux - Software 2 08-25-2003 06:10 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:50 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration