SOLVED: centos 7 shutdown will not poweroff

General support questions
Post Reply
neuronetv
Posts: 89
Joined: 2012/01/08 21:53:07

SOLVED: centos 7 shutdown will not poweroff

Post by neuronetv » 2016/10/16 18:18:05

I have centos 7 running on a dell 9200 tower and the 'shutdown - h now command' does bot result in the machine powering off, which it should, instead it sits at 'System Halted'. After trawling google I edited /etc/systemd/logind.conf and uncommented HandlePowerKey but it made no difference. The machine's BIOS is bang up to date and if I swap the centos 7 hard drive for a windows xp hard drive the machine powers off fine, so I expect it's a problem in centos 7. I also tried shutdown -P now but that also goes to 'system halted', the same with 'systemctl poweroff'. I need this machine to poweroff so thanks for any advice.
Last edited by neuronetv on 2016/10/17 12:19:06, edited 1 time in total.

lightman47
Posts: 1522
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: centos 7 shutdown will not poweroff

Post by lightman47 » 2016/10/16 22:22:47

Some time ago (month or two or more) a couple HP laptops of mine began taking well OVER a half hour to shut down. They eventually do, but it was some update that started this. I guess I've just been awaiting the update that fixes it ...

-for what it's worth-

hunter86_bg
Posts: 2019
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: centos 7 shutdown will not poweroff

Post by hunter86_bg » 2016/10/17 06:48:00

First task is to check the logs. What is the last entries in the journal ?
Here is an example from my Fedora , but it should be 99% the same:

Code: Select all

journalctl -b -1 -n 10
<month> <Date> <time> <hostname> systemd[1]: Reached target Shutdown.
<month> <Date> <time> <hostname> systemd[1]: Reached target Final Step.
<month> <Date> <time> <hostname> systemd[1]: Starting Power-Off...
<month> <Date> <time> <hostname> systemd[1]: Shutting down.
<month> <Date> <time> <hostname> systemd-shutdown[1]: Sending SIGTERM to remaining processes...
<month> <Date> <time> <hostname> systemd-journald[826]: Journal stopped
Did it report any issue ?

neuronetv
Posts: 89
Joined: 2012/01/08 21:53:07

Re: centos 7 shutdown will not poweroff

Post by neuronetv » 2016/10/17 08:22:25

thanks for your response:

Code: Select all

# journalctl -b -1 -n 10
-- Logs begin at Mon 2016-10-17 09:58:05 BST, end at Mon 2016-10-17 09:19:49 BST. --
Oct 17 09:18:00 dell-9200.svr systemd[1]: Stopped Collect Read-Ahead Data.
Oct 17 09:18:00 dell-9200.svr systemd[1]: Stopping Collect Read-Ahead Data...
Oct 17 09:18:00 dell-9200.svr systemd[1]: Reached target Shutdown.
Oct 17 09:18:00 dell-9200.svr systemd[1]: Starting Shutdown.
Oct 17 09:18:00 dell-9200.svr systemd[1]: Reached target Final Step.
Oct 17 09:18:00 dell-9200.svr systemd[1]: Starting Final Step.
Oct 17 09:18:00 dell-9200.svr systemd[1]: Starting Power-Off...
Oct 17 09:18:00 dell-9200.svr systemd[1]: Shutting down.
Oct 17 09:18:00 dell-9200.svr systemd-shutdown[1]: Sending SIGTERM to remaining processes..
Oct 17 09:18:00 dell-9200.svr systemd-journal[499]: Journal stopped
looks much the same as yours...

giulix63
Posts: 1305
Joined: 2014/05/14 10:06:37
Location: UK

Re: centos 7 shutdown will not poweroff

Post by giulix63 » 2016/10/17 08:26:20

Dodgy ACPI, perhaps? Try adding

Code: Select all

acpi=off
as a kernel parameter on your kernel line in grub2.
Root is evil: Do not use root (sudo) to run any of the commands specified in my posts unless explicitly indicated. Please, provide the necessary amount of context to understand your problem/question.

neuronetv
Posts: 89
Joined: 2012/01/08 21:53:07

SOLVED: centos 7 shutdown will not poweroff

Post by neuronetv » 2016/10/17 12:18:43

I must have had an error in either /boot/grub2/grub.cfg or /etc/default/grub. I connected a different hard drive, installed centos 7 new and took a copy of these two files, then copied them back to my previous centos 7 install and now it powers off correctly.

hunter86_bg
Posts: 2019
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: SOLVED: centos 7 shutdown will not poweroff

Post by hunter86_bg » 2016/10/17 17:53:01

Next time you don't need to copy from another installation.You can always regenerate the grub menu via:
For UEFI:

Code: Select all

grub2-mkconfig -o /etc/grub2-efi.cfg
If not using UEFI:

Code: Select all

grub2-mkcongif -o /etc/grub2.cfg

Havenard
Posts: 1
Joined: 2018/09/06 04:06:13

Re: SOLVED: centos 7 shutdown will not poweroff

Post by Havenard » 2018/09/06 04:17:25

Gentlemen, I managed to find a solution. I know this thread is old, but this is one of the first Google results when searching the matter, so I'll update it to help others.

First install acpid

yum -y install acpid
systemctl start acpid
systemctl enable acpid


Then edit /etc/default/grub to include acpi=force reboot=warm in the end of the existing GRUB_CMDLINE_LINUX=.

Rebuild grub config:

grub2-mkconfig -o /etc/grub2.cfg

Reboot to take effect.

This solved the problem for me on a Intel DB85FL motherboard where after a BIOS update CentOS wouldn't poweroff no matter what.

Also, just for the sake of documentation this is my experience with alternative solutions:

Simply putting the kernel setting pci=noacpi solved the problem, but created others. The system took 10 times longer to boot and the LAN adapter wasn't being detected.
The kernel setting acpi=off was making the system freeze instead of shutting down. Was also taking longer to boot.
Disabling Wake on LAN didn't cause any effect.

Post Reply