Raspberry Pi 1 Model A running Raspbian Stretch Lite here. What's the preferred method for elegantly shutting down the pi (so that all services shut down correctly & safely, etc.)?
Looks like I have several options:
sudo shutdown -h now
sudo shutdown -P now
sudo poweroff
sudo halt -p
sudo init 0
Or I could just unplug the power and let it crash (I don't like this method).
Ideally my teardown procedure would be something like:
- When I'm ready to shut it down, SSH into the RPi
- Issue some command (see above -- any ideas?) to shut it down
- Wait for all the onboard lights to turn off
- Unplug the power (Micro USB) safely
Just wondering if there is a preferred/best practices way to go about this.
man
page does state that, and ALL are symlinks to/bin/systemctl
(as are many other commands) BUT (at least on the Pi) they are NOT identical. I usepoweroff
because it provides a visual indication when shutdown is complete - https://raspberrypi.stackexchange.com/a/42188/8697 – Milliways Sep 15 '17 at 23:51shutdown now
,poweroff
, andhalt
. – goldilocks Sep 16 '17 at 12:35poweroff
gives 10 binks at 1 second intervals. (At least it did on Jessie; I rarely power my Pi off and haven't checked recently.) I normally useheartbeat
so the difference is obvious. – Milliways Sep 16 '17 at 22:45