Pi4 headless shutdown

Oct 28, 2020 14 Replies

Hi all, I just assembled a raspberry-pi with these items:



- pi4 board (4gb ram)



- 16gb microsd card (with archlinux-arm 64bit on);



- X832 board (to attach a 3.5 HDD);



- 12V power supply (as needed by X832).


The system started as soon as I plugged in the power adapter to the wall socket (red and blue lights blinking) This is a headless configuration (no monitor, no keyboard, no mouse), so I managed to ssh to the archlinux OS, configure pacman keyring and then was dinner time :)



To shutdown the system I sent this command via ssh: systemctl poweroff



The ssh connection was closed, but the raspberry had red lights still on, and I could hear a fan spinning.



I waited 5 minutes without visible changes, then I pulled the plug off the socket.



Can you please confirm I shuted down the system the proper way?



Thanks in advance, bye!


Tilt

The red LED beside the USB-C power socket on both a Pi3 and a Pi4 seems to indicate that the Pi is connected to power, not that it is booted up. I've often thought that it would be a good idea if the LED indicated (by going out) that the Pi had shutdown and it was safe to pull the power lead out, as for a Windows PC - but that's not the case. I tend to rely on a lack of flickering of the green LED to indicate that the Pi is safely turned off. It's difficult to be certain when the only way you communicate with the Pi is by a network connection (eg VNC or SSH); at least with a monitor connected to the HDMI, you can look for the monitor image disappearing when the power is off. But even though the Pi is connected to a monitor (my TV), it's a pain to have to turn the TV on and set it to the correct HDMI input to verify when the Pi is off. (*)

I wonder if the CPU fan is powered directly from the USB-C input, and not by the CPU being powered on, and that's why it stays on.

By the way, I see the other light, the one that flickers, as being green rather than blue. But everyone's colour vision is different!

(*) Given that you are operating the Pi headless and haven't said that it won't boot, I take it you've discovered the "hdmi_force_hotplug=1 # allow Pi to boot with no monitor connected" line in /boot/config! Another useful line is "hdmi_mode=82 # force 1920x1080x60 even though monitor can't be auto-detected" if you intend to connect to the Pi by VNC: it makes sure that the clietn which is viewing the Pi sees a full 1920x1080 desktop rather its size defaulting to whatever it feels like.

Can you try:

# nohup systemctl poweroff

Ottavio Caruso

Being 'old school' I tend to use sudo shutdown -h now

There is also information available about how to use a push button wired to a couple of pins and some software to make a shutdown switch.

Stuff powered by the usb-c port will still have power, but it is safe to pull the plug.

Absolutely. There are so many options one can use with shutdown. I sometime use the direct reboot option with sudo shutdown -r now.

B. Alabay

I added these lines to /etc/rc.local on my PIs:

echo none > /sys/class/leds/led1/trigger echo 0 > /sys/class/leds/led1/brightness

Now the red LED extinguishes when the Pi has finished booting, and comes on again when it is fully shut down.

Dave

How do know its on? Assuming you don't have a noisy fan.

---druck

Presumably working webservers, ssh and ping. That's how I know mine are on.

If you can't tell its on, it isn't doing anything useful is it?

Of what good are dead warriors? ? Warriors are those who desire battle more than peace. Those who seek battle despite peace. Those who thump their spears on the ground and talk of honor. Those who leap high the battle dance and dream of glory ? The good of dead warriors, Mother, is that they are dead. Sheri S Tepper: The Awakeners.

Ottavio Caruso in data 28/10/2020 22:59 ha scritto:

nohup: ignoring input and appending output to 'nohup.out' Connection to x.x.x.x closed by remote host Connection to x.x.x.x closed.

Tilt

ray carter in data 29/10/2020 01:42 ha scritto:

I'm considering a case with a power button, but I prefer to configure the raspberry first (mount hard disks, setup nfs and so on), thanks :)

Tilt

Just make sure it does a clean shutdown before it cuts power.

That's how you know, others may say "well there was no lights on, so I borrowed the cable to charge my phone".

---druck

bah humbug - sudo init 0 :-0

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required