Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
no poweroff on reboot or shutdown
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
jyoung
Guru
Guru


Joined: 20 Mar 2007
Posts: 443

PostPosted: Wed Dec 27, 2023 4:30 am    Post subject: no poweroff on reboot or shutdown Reply with quote

My system recently picked up a bug where it won't poweroff when I issue either "reboot" or "shutdown -h now". In both cases, it goes through the normal shutdown steps, but halts without an error message at the power-off stage. This sounds nearly identical to this thread:

https://unix.stackexchange.com/questions/264189/computer-doesnt-power-off-at-shutdown-reboot-arch

But their solution, adding "acpi=force" to GRUB_COMMAND_LINE_DEFAULT didn't work for me.

Unfortunately, I don't reboot that often, so I'm not sure when this first started, except that it was in the past few months, so it's hard to say when update(s) might have caused it.

Any ideas?
Back to top
View user's profile Send private message
jyoung
Guru
Guru


Joined: 20 Mar 2007
Posts: 443

PostPosted: Thu Dec 28, 2023 10:29 pm    Post subject: Reply with quote

I also tried setting "acpi=off" in grub. To me, this seems counter intuitive, but I wanted to see what would happen. This had no effect on this issue, and the only change I can see is that the system isn't able to set the hardware clock at boot.

I also looked through the bio settings, and couldn't find anything that seemed related.

One other note: this system is dual-booted with windows, and, although I mostly just use linux, yesterday I had to boot into windows. Windows was able to poweroff without issues, so I doubt that it's a hardware problem.
Back to top
View user's profile Send private message
entity
Tux's lil' helper
Tux's lil' helper


Joined: 16 Jun 2002
Posts: 92
Location: Joensuu, Finland

PostPosted: Sun Feb 04, 2024 6:27 pm    Post subject: Reply with quote

I recently faced similar issue after system update. For me, it was
Code:
sys-apps/sysvinit-3.08
that caused it, and reverting to
Code:
sys-apps/sysvinit-3.07
got poweroff working again.

Edit: this post seems to cover the issue.
Back to top
View user's profile Send private message
jyoung
Guru
Guru


Joined: 20 Mar 2007
Posts: 443

PostPosted: Tue Apr 23, 2024 3:50 am    Post subject: Reply with quote

entity, thanks for chiming in, I'm still scratching my head on this one. I just tried rolling back to

Code:
sys-apps/sysvinit-3.07


but no luck.
Back to top
View user's profile Send private message
amair
n00b
n00b


Joined: 12 Aug 2003
Posts: 61

PostPosted: Tue Apr 23, 2024 6:09 am    Post subject: Reply with quote

When I upgraded to sys-apps/sysvinit-3.08 I received this elog message:
Quote:
Previously, the 'halt' command caused the system to power off even if option -p was not given. This long-standing bug has been fixed, and the command now behaves as documented.

So if I read "man shutdown" correctly, you should run "shutdown -h -P now".

"man halt" says you must run "halt -p" or "poweroff".
Back to top
View user's profile Send private message
entity
Tux's lil' helper
Tux's lil' helper


Joined: 16 Jun 2002
Posts: 92
Location: Joensuu, Finland

PostPosted: Tue Apr 23, 2024 1:16 pm    Post subject: Reply with quote

amair wrote:

"man halt" says you must run "halt -p" or "poweroff".


Indeed. But I gotta say, it took a while to override the default behavior between chair and keyboard, since I have been typing "halt" for the past 20+ years to turn off my workstation. :lol:
Back to top
View user's profile Send private message
jyoung
Guru
Guru


Joined: 20 Mar 2007
Posts: 443

PostPosted: Wed Apr 24, 2024 8:55 pm    Post subject: Reply with quote

Interesting... I just tried

Code:
shutdown -h -P now


And for the sake thoroughness

Code:
shutdown -h -P now


And neither of these worked.
Back to top
View user's profile Send private message
wjb
l33t
l33t


Joined: 10 Jul 2005
Posts: 609
Location: Fife, Scotland

PostPosted: Thu Apr 25, 2024 11:50 am    Post subject: Reply with quote

Just add one line in ~/.bashrc and carry on as normal
Code:

alias halt="poweroff"
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21669

PostPosted: Thu Apr 25, 2024 12:27 pm    Post subject: Reply with quote

Although the timing is unfortunate, it looks to me like OP's problem has nothing to do with the bug fix in sys-apps/sysvinit. OP specifically stated that he tried using the pre-fix version, and it did not help. Additionally, he has tried the elaborated invocation that is supposed to work in the post-fix version, and it does not help. I have used shutdown -h now successfully, and the system powered off, when using =sys-apps/sysvinit-3.08, a version which supposedly requires you to "do it right." Based on all this, I think OPs' problem is not in with the bug fix in sys-apps/sysvinit. Instead, this is some other problem. OP: if you increase the kernel's output verbosity, do the final lines left on screen provide anything useful? Does the sysrq that forces an immediate poweroff (without syncing, so you must save your data first!) turn off power in the bad case? Based on your kernel upgrade history, is there a last known good / first known bad kernel?
Back to top
View user's profile Send private message
jyoung
Guru
Guru


Joined: 20 Mar 2007
Posts: 443

PostPosted: Sun Apr 28, 2024 4:39 am    Post subject: Reply with quote

Hu, that's a neat trick, I didn't know about sysrq until now. If I force a shutdown with

Code:
echo t > /proc/sysrq-trigger


The power stays on. However, if I force a reboot with

Code:
echo b > /proc/sysrq-trigger


then it actually does reboot, which I don't get with the shutdown or reboot commands.

If I set the kernel argument loglevel=8 and reboot, then these messages appear in /var/log/messages the next time I attempt a shutdown

Code:
Apr 28 00:16:30 homebox shutdown[4192]: shutting down for system halt
Apr 28 00:16:30 homebox init[1]: Switching to runlevel: 0
Apr 28 00:16:30 homebox elogind-daemon[4146]: Removed session 2.
Apr 28 00:16:30 homebox su[4187]: pam_unix(su:session): session closed for user root
Apr 28 00:16:30 homebox init[1]: Trying to re-exec init
Apr 28 00:16:30 homebox start-stop-daemon[4261]: Will stop /usr/sbin/sshd
Apr 28 00:16:30 homebox start-stop-daemon[4261]: Will stop PID 4103
Apr 28 00:16:30 homebox start-stop-daemon[4261]: Sending signal 15 to PID 4103
Apr 28 00:16:30 homebox sshd[4103]: Received signal 15; terminating.
Apr 28 00:16:30 homebox start-stop-daemon[4357]: Will stop /usr/sbin/nginx
Apr 28 00:16:30 homebox start-stop-daemon[4357]: Will stop PID 4071
Apr 28 00:16:30 homebox start-stop-daemon[4357]: Sending signal 15 to PID 4071
Apr 28 00:16:31 homebox start-stop-daemon[4433]: Will stop /usr/sbin/rpc.idmapd
Apr 28 00:16:31 homebox start-stop-daemon[4433]: Sending signal 15 to PID 3974
Apr 28 00:16:31 homebox rpc.idmapd[3974]: exiting on signal 15
Apr 28 00:16:31 homebox start-stop-daemon[4479]: Will stop /sbin/rpc.statd
Apr 28 00:16:31 homebox start-stop-daemon[4479]: Will stop PID 3914
Apr 28 00:16:31 homebox start-stop-daemon[4479]: Sending signal 15 to PID 3914
Apr 28 00:16:31 homebox start-stop-daemon[4503]: Will stop /sbin/rpcbind
Apr 28 00:16:31 homebox start-stop-daemon[4503]: Sending signal 15 to PID 3884
Apr 28 00:16:31 homebox start-stop-daemon[4600]: Will stop /usr/sbin/crond
Apr 28 00:16:31 homebox start-stop-daemon[4600]: Will stop PID 3855
Apr 28 00:16:31 homebox start-stop-daemon[4600]: Sending signal 15 to PID 3855
Apr 28 00:16:31 homebox crond[3855]: (CRON) INFO (Shutting down)
Apr 28 00:16:31 homebox start-stop-daemon[4673]: Will stop /usr/bin/dbus-daemon
Apr 28 00:16:31 homebox start-stop-daemon[4673]: Will stop PID 3453
Apr 28 00:16:31 homebox start-stop-daemon[4673]: Sending signal 15 to PID 3453
Apr 28 00:16:31 homebox start-stop-daemon[4702]: Will stop /usr/sbin/syslog-ng
Apr 28 00:16:31 homebox start-stop-daemon[4702]: Will stop PID 3420
Apr 28 00:16:31 homebox syslog-ng[3420]: syslog-ng shutting down; version='4.6.0'
Apr 28 00:16:31 homebox start-stop-daemon[4702]: Sending signal 15 to PID 3420


Nothing looks weird to me here, but maybe you folks can spot something.

Looking back at kernel updates and other config history, unfortunately I can't pin down anything change that might have caused this. I actually don't reboot that often, and it took me a while to realize that this was a serious and persistent problem.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21669

PostPosted: Sun Apr 28, 2024 2:45 pm    Post subject: Reply with quote

jyoung wrote:
Hu, that's a neat trick, I didn't know about sysrq until now. If I force a shutdown with
Code:
echo t > /proc/sysrq-trigger
The power stays on.
Is this a typo? If not, then the results are expected. Per Documentation/admin-guide/sysrq.rst, sysrq t dumps task information. It is not expected to power off the system. For power off, use sysrq o.
Documentation/admin-guide/sysrq.rst:
``o``       Will shut your system off (if configured and supported).

``t``       Will dump a list of current tasks and their information to your
            console.
Back to top
View user's profile Send private message
jyoung
Guru
Guru


Joined: 20 Mar 2007
Posts: 443

PostPosted: Sun Apr 28, 2024 3:21 pm    Post subject: Reply with quote

Sorry, yes, that was a typo. I was using

Code:
echo o > /proc/sysrq-trigger
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21669

PostPosted: Sun Apr 28, 2024 3:34 pm    Post subject: Reply with quote

Good. That confirms this is a kernel problem. I have never seen a kernel that allowed use of sysrq-poweroff and failed to instantly kill power when that was used. Now that we know it is a kernel problem, you can either search backward to find when it last worked, or try a newer kernel to see if it is already fixed.

If you switch to a text console, raise the kernel's verbosity to maximum, and issue a sysrq-poweroff, is there any useful output? Normally, such output would be lost almost instantly when the system loses power, but perhaps there will be something useful shown on screen in your case.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum