preferred shutdown method

Paul Gear paul at gear.dyndns.org
Wed Nov 24 05:35:10 UTC 2010


On 23/11/10 18:34, Hilario J. Montoliu wrote:
> El 23/11/10 09:22, Kaushal Shriyan escribió:
>> Hi,
> 
>> Which is the preferred method of shutdown of a Linux Server and any
>> specific reason to go with the specific method.
>> Please suggest/guide
> 
>> Shutdown:
> 
>>     * init 0
>>     * shutdown -h now
>>           o -a: Use file /etc/shutdown.allow
>>           o -c: Cancel scheduled shutdown.
>>     * halt -p
>>           o -p: Turn power off after shutdown.
>>     * poweroff
> 
>> Thanks
> 
>> Kaushal
> 
> 
> That's a bit generic question because it deppends on the type of
> init-system is using the GNU/Linux distro you are using.
> 
> It could be sys-v, bsd-style, upstart, etc...
> 
> Check your distro's man shutdown

When the question is asked on the Ubuntu server mailing list, i think
it's fairly safe to assume that the question is about Ubuntu server...
And on Linux, the choice of Sys V or upstart doesn't seem to make any
difference in my experience.

Kaushal, to answer your original question, any of the methods you
suggested should work just fine.  The last two ('halt -p' and
'poweroff') are identical.  On any system with the appropriate power
management utilities installed (which they are by default), halt will
add the -p flag automatically.

Kenyon Ralph's suggestion to use 'shutdown -h -P now' because it's the
most portable is good reasoning.  Personally speaking, i only use
Debian, CentOS, SUSE, and Ubuntu Linux, not any of the BSDs or
traditional Unix systems, so i don't care about portability; i use
'halt' because it's the shortest.  :-)

Paul





More information about the ubuntu-server mailing list