1833685 Members
3649 Online
110062 Solutions
New Discussion

shutdown

 
SOLVED
Go to solution
Jeff Hagstrom
Regular Advisor

shutdown

How do I shut the machine down so I can turn the power off?
7 REPLIES 7
Sajid_1
Honored Contributor
Solution

Re: shutdown

# shutdown -h -y 0
learn unix ..
Victor_5
Trusted Contributor

Re: shutdown

cd /
shutdown -hy 0
James R. Ferguson
Acclaimed Contributor

Re: shutdown

Hi Jeff:

# shutdown -hy 0

You will receive a message on the console that indicates when you should actually power-off the server.

Regards!

...JRF...
Sajid_1
Honored Contributor

Re: shutdown

Hi again,

You have to be with root permission for doing this task. You cannot do this from a mounted file system. -h option is for halt, -y for answering "yes" to question and "0" is the seconds. For restarting replace -h with -r

HTH
learn unix ..
Jeff Schussele
Honored Contributor

Re: shutdown

Hi Jeff,

An alternative to use when you KNOW that you have no critical processes running is:
/etc/reboot
But note that this should never be used in "normal" situations as is does not gracefully shut processes down. It uses brute force to kill them. But it's an option for a faster shutdown when you're in maintenance mode.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Pete Randall
Outstanding Contributor

Re: shutdown

Jeff,

To expand on Jeff's answer, you can use "reboot -rq" or "reboot -hq", depending on whether you want to really reboot or halt, respectively.

Pete

Pete
John Dvorchak
Honored Contributor

Re: shutdown

Reboot is pretty ungracefull about shuting down your system and if you have a database running you could be in for a lot of work. I only use reboot on test systems that I have booted into single user mode. On a normal test or production server I always use:

shutdown -hy 0

Which says shut it down to a "Halt" state, answer the query with a "yes" and have "0" minutes of grace time. If you want to reboot:

shutdown -ry 0

note the "r" instead of the "h" which of course means reboot.
If it has wheels or a skirt, you can't afford it.