Shell shutdown command?

Status
Not open for further replies.

Alexgdb

Dabbler
Joined
Aug 3, 2011
Messages
34
Is there a command to shutdown the server that I can run from the command line?
 

ClassicGOD

Contributor
Joined
Jul 28, 2011
Messages
145
Code:
shutdown -h now
Should work.
 

Alexgdb

Dabbler
Joined
Aug 3, 2011
Messages
34
I've tried that but it waits for any key input to shut down. Is that not normal?
 

ClassicGOD

Contributor
Joined
Jul 28, 2011
Messages
145
try:
shutdown -p now

i've got my Mac OS X syntax mixed up with FreeBSD syntax.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
ClassicGod, you were right the first time. He might need to 'su' first, and then use the root password which should be the same as the 'admin' password.
 

ClassicGOD

Contributor
Joined
Jul 28, 2011
Messages
145
ClassicGod, you were right the first time. He might need to 'su' first, and then use the root password which should be the same as the 'admin' password.

Yes and no - according to FreeBSD man page for shutdown, -h just halts the system and -p halts it and cuts off the power. Depending on the hardware the first one may not shutdown the machine completely.

PS. I see in your avatar that you are a Doctor Who fan? ;) I'm building a case for my NAS from black acrylic and am considering putting Pandorica decal on it ;)
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Shutdown -h is what FreeNAS uses to shut it down, I also use it all the time and it shuts down completely (power off).

:D yeah, Dr. Who too, but that's actually Torchwood.
 

ClassicGOD

Contributor
Joined
Jul 28, 2011
Messages
145
Shutdown -h is what FreeNAS uses to shut it down, I also use it all the time and it shuts down completely (power off).
Accualy I've tested both commands on my FreeNAS install (Beta 4, 64bit) and -h does not cut off the power but -p does. It's probably dependent on the hardware (AHCI and different S states support etc) and my MSI E350IA-E45 requires -p to shutdown completely. FreeNAS is probably smart enough to use the correct one ;)

:D yeah, Dr. Who too, but that's actually Torchwood.
Yeah I know, they are both great shows (I just assumed Torchwood fan = Dr Who fan ;) ) but I prefer Pandorica or new Seal of Rassilon patterns ;)
 
Status
Not open for further replies.
Top