Halt from a Terminal Window

I noticed that the Librem 5 should always be shut down using the Power Off button on the top drop-down screen.

Typically when using Linux, I always have a terminal that I leave open. In most phone and PC operating systems, I don’t like the redundant swipe or click, power off, power off again, to turn the device off. It’s easier to type “halt [Enter]”. But that seems to cause bad things to happen on the Librem 5.

After that kind of shutdown, the battery gets hot when charging, and it can take two full days to charge. Earlier today, I could not get the phone to turn on, no matter what I did. The battery was hot. So I removed the battery and started the phone with no battery, just plugged in. That worked. Then, I shut the phone down properly, replaced the battery, and started the phone again. That also worked. I expected to find the battery completely drained at that point (figuring that a dead battery might load the phone down and prevent a re-start, even when plugged in). But it was at 90% after restarting the phone. It’s hard to say what is going on with this. “Halt” should do a proper shutdown in Linux. But going forward, I’ll turn the phone off using the normal method. I am guessing that there is more to to shutting the phone down than turning off the operating system.

1 Like

halt does not shut down the computer. Even its manpage states so:

Note that on many SysV systems halt used to be synonymous to poweroff, i.e. both commands would equally result in powering the machine off. systemd is more accurate here, and halt results in halting the machine only (leaving power on), and poweroff is required to actually power it off.

After halting, you need to hold the power button for about 5 seconds to make it actually power off.

1 Like

Thanks for the information dos. So when left on with no operating system going, my guess is that the phone might go in to an unretrievable suspend or sleep mode.

1 Like

That’s an interesting failure case I have never considered before, thanks for writing this topic! Now I start to recall that back in the early Birch days my phone was sometimes getting stuck in a similar state after turning it off. Could it be because I used to use halt myself at times? Who knows :laughing:

I figured that a halt state on a mobile phone is pretty much completely useless, and people retaining bad habits shouldn’t necessarily get punished by completely discharging their batteries while they think their phone is off, so I found a way to change halt's behavior and actually power off instead when it’s being used:

2 Likes

It appeared to me that after a halt, that the phone entered a state where even holding the power on button down for significantly longer than five seconds does not restore any functionality to the phone. I had to remove the battery to get the phone back in to a state where it could be turned on again. I assumed at the time that the battery was dead and loading the circuitry down to prevent a reboot. So I didn’t put the battery back in to the phone again until after a successful reboot using an empty battery cavity first, and power from only the charging cable, followed by a proper shutdown of the phone after that. However, based on what dos reports, along with the fact that the battery remained at 92%, I probably could have just booted the phone after removing the battery, putting it back in, and then pressing the power on button. However, prior to removing the battery, nothing I could do for any length of time would restart the phone.

2 Likes

Holding the power button for about 5 seconds will shut the phone off. Then you have to press the button again to turn it back on.

That assumes a cooperative PMIC. If it enters some unresponsive state, you can issue a hard reset by holding the power button for about 15 seconds while unplugged from USB power (it won’t work otherwise). It will turn on by itself once the reset is issued.

1 Like