Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

After entering

shutdown now

in terminal I get everything running normally and then:

All processes ended withing 2 seconds...done
INIT: Going single user
INIT: Sending processes the TERM signal
INIT: Sending processes the KILL signal
Give root password for maintenance(or....

I press Ctrl + D, and it shows me login screen Debian. Shutdown through GUI works properly.

UPDATE 1

It seems some process hangs.

Moreover, I've managed to power off the server through several retries. Recently I've installed only ntp and ntpdate, nothing more.

I suppose it might be it conflicting with iptables.

share|improve this question
add comment

4 Answers 4

up vote 29 down vote accepted

You need to use the -h switch to halt the system. Default for shutdown is to switch to run level 1 (maintenance).

shutdown -h now

See man shutdown.

share|improve this answer
1  
Neither new nor debian specific, it's the same on SuSE (and goes back at least 15 years there). RHEL and descendants do this differently, I believe. –  SvW Mar 23 '12 at 10:10
6  
Not at all -- it's been the default for the last 10 years to my knowledge. It's not Linux specific -- the Solaris shutdown manpage says "By default, shutdown brings the system to a state where only the console has access to the operating system. This state is called single-user." –  womble Mar 23 '12 at 10:12
3  
Haven't tested it on Debian, but on ubuntu to power off the system you could also use the command poweroff without any arguments. –  fdierre Mar 23 '12 at 12:49
1  
@womble you can easily multiply that 10 by 3, it already has this in 80's BSDs. –  Legolas Mar 23 '12 at 14:29
1  
@Legolas: Technically I can't, because it's 10 years "to my knowledge". Just showing my n00bness, I guess. <grin> –  womble Mar 24 '12 at 1:54
show 2 more comments

shutdown now drops your Debian to maintenance mode. Use shutdown -h now instead.

share|improve this answer
add comment

Use the -h option to shutdown to request a halt or a power off instead of just requesting to init that you are going to single user mode (which seems to be the default behaviour)

shutdown -h now
share|improve this answer
add comment

You can save some typing by using 'halt' instead of 'shutdown -h now'

share|improve this answer
4  
No, not really. Some versions of init have this behavior, but others issue a halt instruction in this case, which frequently results in a system hang or reboot. I just tested this on some vm's I have handy, and on upstart and SysVinit, halt is a synonym for poweroff, but on systemd, it hangs after stopping init. –  TokenMacGuy Mar 23 '12 at 17:57
    
Which init does Debian use by default? The rest are pretty irrelevant to a SE answer I believe, and I've never had halt fail on any debian machine I've tried it on. –  gparent Mar 23 '12 at 20:54
1  
With regards to TokenMacGuy’s comment that halt hangs the system, this is true on FreeBSD at least. On FreeBSD, you need halt -p to actually power the system off after halting. –  Jeremy Visser Mar 24 '12 at 5:56
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.