Bug 710532 - The computer restarts when doing a shutdown
Summary: The computer restarts when doing a shutdown
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: 15
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-06-03 16:01 UTC by Sébastien Wilmet
Modified: 2015-11-20 02:53 UTC (History)
30 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-01-26 09:05:03 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Asus PRO50N: lspci -vvv (12.08 KB, text/plain)
2011-06-03 16:01 UTC, Sébastien Wilmet
no flags Details
shutdown.dmesg from a bouncing shutdown (93.44 KB, text/plain)
2011-09-24 23:55 UTC, Miles Sabin
no flags Details
shutdown.dmesg from a bouncing shutdown with more info logged (382.43 KB, text/plain)
2011-10-06 08:14 UTC, paul59584
no flags Details
shutdown.dmesg from a working shutdown with more info logged (318.65 KB, text/plain)
2011-10-06 08:14 UTC, paul59584
no flags Details
YUM Update history after the issue appeared (1.83 KB, text/plain)
2011-11-03 16:19 UTC, v.guast
no flags Details

Description Sébastien Wilmet 2011-06-03 16:01:17 UTC
Created attachment 502844 [details]
Asus PRO50N: lspci -vvv

Description of problem:
When I want to shutdown my computer, sometimes it restarts.

Version-Release number of selected component (if applicable):
kernel.x86_64 2.6.38.6-27.fc15

How reproducible:
Not always.

Steps to Reproduce:
1. Shutdown the computer, for example with the "halt --poweroff" command.
  
Actual results:
Sometimes the computer restarts.

Expected results:
The computer should never restart when shutting it down.

Additional info:
I don't know if it's related, but when I do a restart, the computer doesn't shutdown. The restart is like "halt" without the "--poweroff" parameter.

Since I have this computer (between 2 or 3 years), the restart has never worked. But it's the first time that the shutdown is broken (with Fedora 14 there was no problem).

My computer is an Asus PRO50N. I attach the output of lspci -vvv.
In /var/log/messages, there was 2 messages :

> Jun  3 00:45:53 localhost kernel: Kernel logging (proc) stopped.
> Jun  3 00:45:53 localhost rsyslogd: [origin software="rsyslogd" swVersion="5.7.9" x-pid="807" x-info="http://www.rsyslog.com"] exiting on signal 15.

What can I do for giving more info?

Comment 1 Sébastien Wilmet 2011-06-03 16:24:10 UTC
This bug report:
https://bugzilla.kernel.org/show_bug.cgi?id=35262

is maybe related.

Comment 2 Michael Carney 2011-07-06 18:33:24 UTC
I have a Dell 530n workstation with dual 2GHz Xeons. Ever since I installed Fedora 15, 'poweroff' has meant "reboot". I still have Fedora 14 on this machine, and when running Fedora 14, poweroff means poweroff. So some problem has crept into Fedora 15 to produce this behavior.

Comment 3 Sébastien Wilmet 2011-07-06 19:17:43 UTC
I've installed Gentoo on my computer, and I use the same major version of the kernel (2.6.38). And I don't have this bug anymore.

So I think it doesn't come from the kernel. Maybe systemd?

Comment 4 Michael Carney 2011-07-08 03:52:13 UTC
I think you're right, Sebastien. Systemd replaced upstart in F15, and halt, poweroff, reboot, and shutdown are all symbolic links to systemctl. So the problem I'm experiencing is likely a systemd/systemctl issue.

Comment 5 Cesar Eduardo Barros 2011-07-10 23:46:02 UTC
I have seen this problem in the two machines I installed Fedora 15 on so far: one EeePC 701 netbook and one Asus M2V desktop. Sometimes (around half of the time), when I shutdown the computer (using Gnome or KDE's shutdown menu item, which does a poweroff), it powers down and a fraction of a second later turns itself back up (as if something had asked the BIOS for a wakeup in one second). Asking it to power off again after that (that is, as soon as it gets back to the desktop or login manager, tell it to power back off) so far has worked every time.

This can be particularly scary on the desktop, since you can hear the hard disks and fans spinning down and immediately spinning back up (the EeePC has a SSD, so it is not that scary there).

Comment 6 Richard Körber 2011-07-21 10:48:02 UTC
Does nobody feel responsible for this bug?

I can reproduce this issue on 2 of 4 machines running F15. On one machine (a HTPC) it is especially annoying because it is difficult to reach it physically in order to turn it off.

Comment 7 Michael Cronenworth 2011-07-22 23:18:45 UTC
An ASUS P5B-E motherboard also experiences this issue (sometimes reboots instead of shut down). The system shuts down correctly in all Fedora releases prior to Fedora 15.

Comment 8 Miles Sabin 2011-08-01 01:35:29 UTC
I'm also seeing this behaviour on a Dell Precision M4400.

Comment 9 Michal Schmidt 2011-09-08 08:33:10 UTC
Does "sync && poweroff -f" work reliably for you?

Comment 10 Miles Sabin 2011-09-08 09:01:25 UTC
"sync && poweroff -f" has given me two successive shutdowns without instant reboots so, so far, that looks promising.

Comment 11 Sébastien Wilmet 2011-09-08 15:31:45 UTC
(In reply to comment #9)
> Does "sync && poweroff -f" work reliably for you?

Yes, it does.

Comment 12 Lennart Poettering 2011-09-21 21:09:34 UTC
Please place a script like the following in /lib/systemd/systemd-shutdown/:

<snip>
#!/bin/sh

set -x

mount / -o rw,remount
dmesg > /shutdown.dmesg
mount / -o ro,remount

exit 0
</snip>

Mark the file executable.

This will store away the log data right before rebooting. Then have a look at the log file /shutdown.dmesg , there might be something interesting in there. Attach it here if you find nothing interesting.

Comment 13 Sébastien Wilmet 2011-09-24 15:53:40 UTC
(In reply to comment #12)
> Please place a script like the following in /lib/systemd/systemd-shutdown/:

I place it in system-shutdown/ instead of systemd-shutdown/.

> This will store away the log data right before rebooting. Then have a look at
> the log file /shutdown.dmesg , there might be something interesting in there.
> Attach it here if you find nothing interesting.

Unfortunately the file is empty. I tried several times to shutdown the computer until it reboots instead (the bug occurs randomly on my computer). When the computer shuts down correctly, the file is also empty.

Comment 14 Miles Sabin 2011-09-24 23:55:28 UTC
Created attachment 524758 [details]
shutdown.dmesg from a bouncing shutdown

Comment 15 Miles Sabin 2011-09-24 23:56:37 UTC
Log file from a bouncing shutdown, as requested. This is from a Dell Precision M4400.

Comment 16 Gregory Lee Bartholomew 2011-09-26 20:29:48 UTC
I'm having this issue with my EeePC 900 as well.

sync && poweroff -f caused a successful poweroff though.

FYI,
gb

Comment 17 Michal Schmidt 2011-09-26 22:18:02 UTC
(In reply to comment #13)
> Unfortunately the file is empty.

The write is likely blocked by SELinux. Switch to permissive mode for this test.

(In reply to comment #14)
> shutdown.dmesg from a bouncing shutdown

Could you please repeat the experiment after adding these boot parameters to the kernel command line?:
 log_buf_len=1M systemd.log_level=debug systemd.log_target=kmsg
It will cause more information to be logged.

Apart from the debugging script, do you have any other files in /lib/systemd/system-shutdown/ ?

Comment 18 Miles Sabin 2011-10-01 14:40:38 UTC
I've just reinstalled that maching from x86 to x86_64 and I can no longer reproduce the issue.

Comment 19 paul59584 2011-10-06 08:11:27 UTC
I have this same problem on an f15 x86_64 machine.
It used to happen often, i.e. ~every second time i used the computer but recently has been happening much less often (machine is kept up to date).

Am attaching dmesg files with
 log_buf_len=1M systemd.log_level=debug systemd.log_target=kmsg
added to kernel command line
and no other scripts in
/lib/systemd/system-shutdown/

shutdown.dmesg.poweroffrestarts is when poweroff results in a restart
shutdown.dmesg.poweroffworks is when poweroff works as it should

Comment 20 paul59584 2011-10-06 08:14:07 UTC
Created attachment 526643 [details]
shutdown.dmesg from a bouncing shutdown with more info logged

Comment 21 paul59584 2011-10-06 08:14:57 UTC
Created attachment 526644 [details]
shutdown.dmesg from a working shutdown with more info logged

Comment 22 Fedora Admin XMLRPC Client 2011-10-20 16:26:36 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 23 thunderingexile 2011-10-30 12:28:21 UTC
I also have the same problem with a Dell Precision M4400, just as Miles Sabin. But it really doesn't happen everytime. It never happened with Fedora 14.

Furthermore, I see that nobody mentioned that, but it also happened to me that the laptop turned itself on when I plugged or unplugged the power cord !

Comment 24 seventhguardian 2011-10-30 14:26:23 UTC
I can confirm this has also happened (switching on after connecting/disconnecting power cord).

Moreover, the last time the computer restarted per this bug (yesterday night), it stayed off for about 5 seconds, and only then turned on... Is it possible that this is somewhat event-related?

Comment 25 Cesar Eduardo Barros 2011-10-30 15:18:50 UTC
(In reply to comment #23)
> Furthermore, I see that nobody mentioned that, but it also happened to me that
> the laptop turned itself on when I plugged or unplugged the power cord !

This has also happened to me on the EeePC 701 netbook, but I only recall it happening when plugging the power cord, never when unplugging it.

Comment 26 v.guast 2011-11-03 16:15:26 UTC
The same issue is happening now on my laptop now. It never happened until last updates, now it always happens. I can only switch off using the power button. 
I'll attach a file with the list of the packages changed coming from YUM history.
I checked /var/log/messages, I found only the two messages reported in the bug description.

My laptop is a Dell XPS
Kernel version is 2.6.40.6-0.fc15.x86_64

Comment 27 v.guast 2011-11-03 16:19:44 UTC
Created attachment 531600 [details]
YUM Update history after the issue appeared

List of changed packages taken from YUM history. The issue appeared on my laptop after this update.

Comment 28 Michal Schmidt 2011-11-03 16:24:50 UTC
(In reply to comment #27)
Interesting. Try downgrading them selectively to find the guilty one. I'd start with initscripts or perhaps microcode_ctl.

Comment 29 v.guast 2011-11-03 23:07:29 UTC
> (In reply to comment #27)

I downgraded initscripts from 9.30.1-1.fc15 to 9.30-2.fc15
The first shutdown the PC froze. But after a restart I could start and shutdown it without any problem.
Just to be sure I updated initscripts again to the latest version and downgraded microcode_ctl from 1.17-19.fc15 to 1.17-12.fc15
Then I shutdown the PC and it didn't restart.
It seems the issue is not caused by a single package.Let me know if you need other tests with different combinations of packages.

Comment 30 v.guast 2011-11-04 10:54:27 UTC
(In reply to comment #29)

I made another test upgrading again microcode_ctl and shutting down the PC a couple of times. The shutdown was correct.
The issue may be in the scripts that execute the update under particular circumstances.
Somebody else could test whether downgrading and upgrading again initscripts solves the issue. It would not be the solution, but at least we would have a workaround.

Comment 31 Daryl 2011-12-13 17:49:50 UTC
I have the same problem on Fedora 14. I downgraded to initscripts 9.20.1-1.fc14.i686 from 9.20.2-1.fc14.i686. 

I shutdown from the system menu and got a restart.
I logged back in and chose shutdown again, got a restart again.

no change in behavior from the newer version of initscripts. I've tried shutdown -P from bash and choosing shutdown at the logon screen. All result in restarts!

Comment 32 Pete 2012-01-19 20:43:59 UTC
(In reply to comment #2)
> I have a Dell 530n workstation with dual 2GHz Xeons. Ever since I installed
> Fedora 15, 'poweroff' has meant "reboot". I still have Fedora 14 on this
> machine, and when running Fedora 14, poweroff means poweroff. So some problem
> has crept into Fedora 15 to produce this behavior.

I have the same situation, (except F9 for F14). The saved logs (as LP suggested above) do not indicate differences between a good shutdown and a bad shutdown. The logs do frequently indicate difficulty in updating the micorcode and sometimes fail to initialise a CPU.

As suggested at bbs.archlinux.org/viewtopic.php?pid=1028777#p1028777,
I have added the following work-around
 
echo 0 > /sys/class/rtc/rtc0/wakealarm
echo `date '+%s' -d '+ 1 year'` > /sys/class/rtc/rtc0/wakealarm

to /etc/rc.local, which appears to prevent the bouncing shutdown problem by setting the RTC alarm to a future date.

Comment 33 Armijn Hemel 2012-01-19 22:00:02 UTC
I have noticed that this problem only happens to me once a day. At least, it seems like that. I have had it in the past that a machine kept turning on at least 5 times, but the trend is once a day.

Comment 34 Jóhann B. Guðmundsson 2012-01-25 14:11:52 UTC
please follow what is mentioned in comment 12 thanks

Comment 35 Michael Cronenworth 2012-01-25 14:19:15 UTC
(In reply to comment #7)
> An ASUS P5B-E motherboard also experiences this issue (sometimes reboots
> instead of shut down). The system shuts down correctly in all Fedora releases
> prior to Fedora 15.

This motherboard now works fine with Fedora 16. No restarts since I updated it.

Comment 36 Jóhann B. Guðmundsson 2012-01-25 19:50:19 UTC
Can I get more confirmed fixed or not fixed from the rest of the people on this bug on a fully updated F15/F16 with the latest kernel thanks.

Comment 37 Gregory Lee Bartholomew 2012-01-25 21:49:23 UTC
I haven't had the problem in a long time -- long enough that I've forgotten what I did to make it go away (maybe nothing; it may have gone away with some updates).

Comment 38 paul59584 2012-01-26 00:14:01 UTC
Seemed to disappear a while back for me as well. Machine is kept updated.

Comment 39 Michael Carney 2012-01-26 03:11:35 UTC
No longer a problem since I moved to FC16.

Comment 40 Jóhann B. Guðmundsson 2012-01-26 09:05:03 UTC
So I've noticed that many of you are running asus hw which indicates bios/hw/kernel bug of some sort. 

Some of you here seem to have had this happened prior to f15 which did not even have systemd.

Now the auto power on ( with the future date set in wakealarm workaround ) has a patch mentioned here https://lkml.org/lkml/2012/1/23/541 waiting to be ready to be queued up and those of you that are experiencing that problem can file an RFE against the kernel to atleast build a test kernel for you that contain that patch.

In addition to that I count 5 confirmed fixes so I'm going to close this as current release.

Those of you that still experience this I recommend opening a new bug against the kernel.

"sync && poweroff -f" should still work as a workaround for this particular bug.

Thanks.

Comment 41 Pete 2012-01-27 04:04:08 UTC
(In reply to comment #36)
> Can I get more confirmed fixed or not fixed from the rest of the people on this
> bug on a fully updated F15/F16 with the latest kernel thanks.

Still bounces on a fully updated F15. - 2.6.41.10-3.fc15.i686.PAE

Comment 42 Fakabbir Amin 2015-11-20 02:53:03 UTC

The best possible solution is mentioned in this page : https://www.behnke.io/fedora-17-on-an...

I have tried all above solution but most of the time the solutions are static (top working after few major updates) The following seems to work some of the time : Switch on blutooth, use pendrive always pluged in


Note You need to log in before you can comment on or make changes to this bug.