Request to implement a Raspberry Pi shutdown and restart button

Hello,

I haven’t found a topic discussing this, but a button to properly shut down/restart the Raspberry Pi from Gladys would be a plus.

I think it would fit well in the system menu for administrators.

I quickly saw that it was possible to shut down the host from a Docker, but I haven’t tested it.

Why not, good idea :slight_smile:

Sinon:
Open a terminal (« cmd » in the search bar under Windows or ctrl+alt+T under Linux)
ssh pi@gladys-ip
pi password (raspberry the first time)
sudo shutdown now

What’s a bit less user-friendly, I have to admit haha

A small clarification when you connect for the first time, it asks you to change the password for the pi account.

I ask this because Gladys is in a user-friendly approach. It’s as if in Windows you were told to type the command shutdown /s every time to turn off your PC.

It’s just that sometimes my Raspberry Pi is turned off abruptly because my PC is not necessarily on.

After that, it’s not a feature to develop urgently because for the majority of us we know how to go to a Linux system and shut it down properly.

I’m 100% with you, in v4 the main philosophy is « no CLI, no SSH ».

Hi @pierre-gilles
There is a possibility to have a cron on the Pi that runs a script, say every second
this script can be created in Gladys then copied into the local system
26 commandes Docker les plus courantes avec des exemples partie 19
From there any command can be executed (stop/restart etc.) from the Gladys container on the local system, you just need at startup to have a script that deletes the script previously sent from

That’s indeed an idea, however it’s too risky for me — it’s enough that the script(s) are not deleted and we’ll restart in a loop.

In any case we are in server mode, the need to stop/restart is almost nil.

The only case is a kernel update; in that case you do it manually and can therefore reboot.

There is the possibility of limiting the number of times the script can be executed by using a timestamp-based limit in the script name, for example, or better via crontab, right? So a crontab running every second that watches a script sent from Gladys; in the script there is the 1st crontab command to execute so there’s no risk of a loop, and we can have a log that can be analyzed by a 2nd crontab command of the previous script, which itself can generate a response via a crontab that creates a command in the Gladys container. In short, a way for Gladys to interact with its environment…this could even be integrated into Gladys with scenarios! :face_with_open_eyes_and_hand_over_mouth:

I think the cleanest approach for the host is to use D-Bus (dbus); there’s a Node.js package available.

On the Gladys side we can

Whatever the solution, it would be a real plus for the average user to be able to shut down their system properly (for maintenance purposes, for example) without having to go through an SSH connection that’s not user-friendly! I don’t know D-Bus; would it also work on platforms other than the Raspberry Pi and/or on Windows?