5

I always shut down the system with halt, which is the equivalent of shutdown -h now. On every linux system I've ever used, including up until recently the pi, this halts the system and turns off the power if the hardware is capable.

On the pi -- again, up until recently -- it just shuts the system down so that the power can be unplugged. I generally leave it on 24/7, but occasionally I want to disconnect it from power to tinker or whatever. Sometime in the past few months, I noticed that it was rebooting immediately, and I kind of shrugged it off; I have an 8x8 LED attached as a system monitor, so I'd wait until it signaled runlevel 0 had run then yank the cord.

That's not really ideal IMO, and I am absolutely completely totally positive it was not doing this until recently; I've had the pi for the better part of a year. I just spent some time using shutdown with various switches (-h, -f, -P, -n) and combinations of switches, and none of them will halt the system without triggering an immediate reboot.1

My first thought is that something is causing a quick voltage drop and that triggers the reboot, but that's just a thought. So my questions are:

  1. Has anyone else noticed this?

  2. Does anyone have any idea about why it would happen? A recent firmware update? [As it turns out, I hadn't been updating the firmware -- see my answer].


1 Correction : shutdown -fn now will halt it, although this means skipping the init scripts intended to stop services correctly (BTW I don't see anything in /etc/rc0.d that would cause the reboot) and mysteriously leaves the board's ethernet lights on, presumably because the networking service was not properly stopped.

8
  • 2
    I did some testing with my Raspberry Pi, and it did not experience the behavior your are describing, odd.
    – syb0rg
    Commented Dec 10, 2013 at 5:01
  • @syb0rg : Yeah, this is for sure a fairly recent change in behavior.
    – goldilocks
    Commented Dec 11, 2013 at 10:35
  • 1
    Any chance, Wake-On-LAN is causing this? Is it an immediate reboot? Commented Dec 11, 2013 at 12:43
  • 1
    I can't find anyone claiming to have actually gotten WOL to work on the pi, so if it is I guess I am lucky, ;). Anyway, it's an immediate reboot, yeah.
    – goldilocks
    Commented Dec 11, 2013 at 12:54
  • Does it also happen if you disconnect all USB, GPIO, and network cables?
    – Gerben
    Commented Dec 11, 2013 at 14:33

2 Answers 2

3

I installed and ran rpi-update. This replaced a lot of files in /boot, and, I noticed, installed a lot of modules for a 3.10.24+ kernel, which I wasn't aware existed (my git clone of the archive was fixed on 3.6.11, and that's the latest one I had on the pi).

So I built 3.10.24+ (the current stable for the pi) using /proc/config.gz from my 3.6.11 kernel -- i.e., I did not change the configuration at all. This potentially overwrote the stuff in /lib/modules/3.10.24+ installed by rpi-update, so I ran that again (first removing /boot/.firmware_revision to make it do everything over). Unfortunately, the modules from rpi-update did not jibe ("disagrees about version of symbol module_layout"). I couldn't resolve that,1 so I went back to my vanilla modules directory from the build.

Rebooting at this point solved the problem. It is worth noting that it persists with the old kernel, so it was not simply a matter of the firmware in /boot; also I rebooted after the firmware revision, before building the new kernel. However, the rpi-update README does note "some firmware updates might depend on a kernel update" (although AFAICT, rpi-update doesn't provide a kernel update!). To summarize:

  • Running rpi-update with 3.6.11 kernel did not fix the problem.

  • Installing a 3.10.24+ kernel after rpi-update did fix the problem. This kernel was built starting with the same .config as the 3.6.11 kernel. I did not use the /lib/modules stuff installe by rpi-update as the kernel rejected them.

  • Reverting to the old kernel causes the problem to return.

I'm perplexed as to why this would have happened in the first place, but it could be that it did start with my last build of 3.6.11; the only difference between that and the previous one was making i2c-dev a built-in.


1 Perhaps they are intended for a pre-built kernel available from...somewhere.

0

I really don't know the cause of that behaviour, but to shutdown my RPIs, I usually use poweroff, which, I think is equivalent to shutdown -h now:

$ sudo poweroff

Hope it will help.

2
  • No such luck! It's definitely not supposed to be this way.
    – goldilocks
    Commented Dec 11, 2013 at 10:36
  • poweroff and shutdown are both links to systemctl, so if one command is broken, the other will be broken too. Commented Mar 12, 2020 at 18:57

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