We have moved to a new Sailfish OS Forum. Please start new discussions there.

# Shutting down Jolla with "halt" command? [not relevant]

Hello. I was in the Terminal and wanted to shut down my phone, so I tried to do so using the "halt" command. After I pressed enter, it waited 2 seconds and the screen became black instantly, without having the bottom red led as when we press the power button.

But then when I plugged it into the charger, or when I tried to boot, nothing happened. And I noticed that a red led was visible on the proximity sensor. The phone was apparently stuck. I removed the battery, the led switched off and I was then able to boot normally.

But since then, I can see this red led on the proximity sensor (on the right). It's not very flashy but if I am in the dark I can perfectly see it and I don't remember to have seen it before.

So my questions:

• Has somebody already tried the "halt" command. Is it bad to use it? I am afraid to retry.
• Are you able to see this led on your phones? Is it normal or should I do a reset?

Thanks!

edit retag reopen delete

### The question has been closed for the following reason "question is not relevant or outdated"by Sthocs close date 2017-11-13 13:40:17.346157

I have been using the "init 6" command every time I want to restart the phone. However I've been told by a few friends (Linux users) that that's the same as removing the battery (well, almost).

That being said, can someone confirm it, and if it's not a proper way, point me in the right direction? Maybe with systemctl?

Regards. ~Chinoman10

( 2014-04-07 00:39:16 +0300 )edit

i used init 0 once... seemed to work, instant shutdown

( 2014-05-08 16:13:33 +0300 )edit

Sort by » oldest newest most voted

Haven't tried halt and haven't seen any red leds (except the one bottom/middle of the device when shutting down). Just wanted to note that commands like 'halt' and 'shutdown' are symlinks to /bin/systemctl so to find out what those commands are actually trying to do you could check the help or the source of that command.

Doing systemctl --help tells us that option 'halt' is for shutting down and halting the system (but not power off), and 'poweroff' option is for shutting down and powering off the system

So, if you ran the halt command without any options, seems that it actually executed systemctl halt, while you probably wanted it to do systemctl poweroff. So before you do factory resets or anything that radical, It might help to check the other systemctl command options, and e.g. try to reboot using those.. at your own risk, ofc ;)

Someone more knowledgeable could tell you more about the boot/init and reboot/shutdown of SailfishOS and all it's services from command-line, and also abt how these commands map to pressing the power button-

more

It depends on kernel what it does in Jolla for halt. Normally CPU executes nothing and waits for reset and that will bring it back to bootloader.

( 2014-01-26 00:02:52 +0300 )edit
1

In this case, the key piece of information is which systemctl command (if any) and with which options the device is executing when power-button is pressed to turn it off. If it is just systemctl halt (which I doubt) then power on from that couldn't have caused any issues. But if the system does something else when properly turning off then something may have happened when just halt alone was executed.

( 2014-01-26 00:12:15 +0300 )edit
1

Thank you for these info @jjaone. It's weird to halt the system without powering off. Old debian habit where poweroff halt or shutdown behave the same :(

I actually tried the "poweroff" command today and it works when logged as a user (need to be root for halt). It seems to shut down the phone properly, only the vibration and the red led are missing. But I still can see this "proximity sensor red light" when the phone is on (it's not a light, more some kind of infrared emitter). I am waiting to see if some Jolla people come here before maybe trying to reset the phone (everything works fine but I'm still a little worried :P)

( 2014-01-27 01:10:50 +0300 )edit

halting is just a feature in linux-kernel and sometimes on different platforms it has its purpose. When halted the kernel is already gone and the CPU is semi-dead waiting for reset. IMHO, it does not make sense to have a special systemd that does not have halt just for Jolla.

( 2014-01-28 12:57:08 +0300 )edit

Nowadays running "halt" from command line executes "/usr/sbin/dsmetool --shutdown".

For details, see: https://together.jolla.com/question/77099/unreliable-reboot-command/

more

Thanks, I will use the occasion to close this old question! I figured out since then that this little "red led" is just the proximity sensor, and is visible on other phones as well, totally unrelated with the halt command.