Hola,
No he encontrado ningún tema sobre esto, pero un botón para apagar/reiniciar correctamente la Raspberry desde Gladys sería un plus.
Creo que tendría su lugar en el menú del sistema para los administradores.
He visto rápidamente que es posible apagar el host desde un Docker, pero no lo he probado.
¿Por qué no? ¡Buena idea :)!
Fabic
13 Enero, 2022 20:00
3
Sinon:
Abrir una terminal (« cmd » en la barra de búsqueda en Windows o ctrl+alt+T en Linux)
ssh pi@ip-de-gladys
contraseña del pi (raspberry la primera vez)
sudo shutdown now
Lo que es un poco menos amigable para el usuario, hay que admitirlo jaja
pequeña precisión al conectarse por primera vez, solicita el cambio de contraseña de la cuenta pi.
Lo pido porque Gladys está en un enfoque de usuario amigable. Es como si en Windows te dijeran que ingresaras el comando shutdown /s cada vez para apagar tu PC.
Es solo que a veces mi Raspberry se apaga de forma brusca porque mi PC no siempre está encendido.
Después no es una función para desarrollar con urgencia, ya que la mayoría de nosotros sabemos cómo ir a un sistema Linux y apagarlo correctamente.
Estoy 100% de acuerdo contigo, en la v4 la filosofía principal es « sin CLI, sin SSH ».
cce66
28 Diciembre, 2022 17:53
7
Hola @pierre-gilles
¿Hay alguna posibilidad de tener un cron en la Raspberry Pi que ejecute un script, digamos, cada segundo?
Este script puede crearse en Gladys y luego copiarse en el sistema local
26 commandes Docker les plus courantes avec des exemples parte 19
A partir de ahí, cualquier comando puede ejecutarse (apagado/reinicio, etc.) desde el contenedor Gladys en el sistema local, solo hay que tener un script al inicio que elimine el script enviado desde Gladys anteriormente.
Incluso sería posible tener un estado de retorno con exec en el script 26 commandes Docker les plus courantes avec des exemples parte 7, solo hay que crear un archivo en el Docker con el comando adecuado.
VonOx
28 Diciembre, 2022 19:48
8
Es una idea, sin embargo, demasiado arriesgada para mí, basta con que el/los scripts no se eliminen y se reinicia en bucle.
En cualquier caso, estamos en modo servidor, la necesidad de detener reiniciar es casi nula.
Único caso un update del kernel, en este caso eres tú quien lo hace manualmente y, por lo tanto, puede reiniciar.
cce66
28 Diciembre, 2022 20:05
9
¿Hay la posibilidad de limitar el número de veces que un script puede ejecutarse mediante un límite de marca de tiempo en el nombre del script, por ejemplo, o mejor aún mediante crontab, no? Por lo tanto, un crontab cada segundo que supervisa un script enviado desde Gladys, en el script hay el primer comando crontab a ejecutar, por lo que no hay riesgo de bucle y se puede tener un registro que puede ser analizado por un segundo comando crontab del script anterior, que a su vez puede generar una respuesta a través de un crontab que genera un comando en el contenedor Gladys. En resumen, algo para hacer interactuar a Gladys con su entorno… ¡incluso podría integrarse en Gladys con los escenarios!
VonOx
28 Diciembre, 2022 20:09
10
Creo que lo más limpio para el host es pasar por dbus, hay un paquete de nodejs disponible.
Por parte de Gladys, podremos verificar que dbus esté disponible en el contenedor, y si es así, mostrar el/los botones. Y sí, ¿por qué no tener también en las escenas una acción disponible.
Y en este caso, limitamos los riesgos.
cce66
30 Diciembre, 2022 22:23
11
Cualquiera que sea la solución, sería un verdadero plus para el usuario común poder detener su sistema correctamente (por ejemplo, por una cuestión de mantenimiento) sin tener que pasar por una conexión SSH poco amigable. No conozco dbus, ¿también funcionaría en otras plataformas que no sean PI y/o en Windows?
Lokkye
24 Julio, 2026 14:18
12
He (Claude :)) empezado a hacer una implementación simple usando dbus.
Tengo que hacer las pruebas en mi instalación con docker, pero va por buen camino.
Lokkye
24 Julio, 2026 19:31
13
Probar en mi MiniPC con Debian
Los PR que funcionan bien:
master ← callemand:feature/reboot-shutdown-host-docs
ouvert 02:43PM - 24 Jul 26 UTC
Documents the new **Reboot / Shutdown host** feature added in GladysAssistant/Gl… adys#2709.
- Add `-v /run/dbus:/run/dbus:ro` to the `docker run` command so the buttons (Settings → System) can reach systemd-logind over the system D-Bus socket.
- Add a "Reboot / Shutdown the host from Gladys" section explaining the requirements (systemd host, `--privileged`, D-Bus socket) and behaviour.
- English (`docs/`) and French (`i18n/fr`) versions.
Companion PR: GladysAssistant/Gladys#2709
🤖 Generated with [Claude Code](https://claude.com/claude-code)
master ← callemand:feature/reboot-shutdown-host
ouvert 02:42PM - 24 Jul 26 UTC
### Pull Request check-list
To ensure your Pull Request can be accepted as fast… as possible, make sure to review and check all of these items:
- [x] If your changes affect the code, did you write the tests?
- [x] Are server tests passing with coverage? (`cd server && npm run coverage`) — Codecov requires **100% coverage on lines changed in this PR** _(the new functions `rebootHost`/`shutdownHost`/`isHostPowerManagementAvailable` are at 100%; the new controller handlers and the added `getInfos` line are covered too)_
- [x] Did Cypress E2E tests pass? (`npm run cypress:run` from repo root, if UI changed) _(left to CI)_
- [x] Is the linter passing? (`npm run eslint` on both front/server)
- [x] Did you run prettier? (`npm run prettier` on both front/server)
- [x] If you are adding a new feature/service, did you run the integration comparator? (`npm run compare-translations` on front) — en/fr/de complete
- [x] Did you test this pull request in real life? With real devices? _(AMD64 test image being built for a real x86_64 host running systemd)_
- [x] If your changes modify the API (REST or Node.js), did you modify the API documentation? (apidoc `@api` comments added for the two new endpoints)
- [x] If you are adding a new features/services which needs explanation, did you modify the user documentation? See https://github.com/GladysAssistant/v4-website — done in `feature/reboot-shutdown-host-docs` (EN + FR)
- [ ] Did you add fake requests data for the demo mode (`front/src/config/demo.js`)? _N/A — no new device/service data, only two admin actions_
NOTE: these things are not required to open a PR and can be done afterwards / while the PR is open.
### Description of change
Adds the ability to **reboot or shut down the host machine** running Gladys (Raspberry Pi, mini-PC…) directly from the **Settings → System** page — a frequently requested feature ([forum](https://community.gladysassistant.com/t/demande-de-mise-en-place-dun-bouton-arret-et-redemarrage-du-raspberry/6786)).
Until now `system.shutdown()` only stopped the Gladys process; there was no way to power off / reboot the underlying host.
**Mechanism.** The two actions talk to `systemd-logind` over the host **system D-Bus socket** (`org.freedesktop.login1` → `Reboot` / `PowerOff`, non-interactive), via `dbus-send`. No new npm dependency; the `dbus` package is added to both Docker images so `dbus-send` is present.
**Backend**
- `system.rebootHost` / `system.shutdownHost`: call systemd-logind through D-Bus.
- `system.isHostPowerManagementAvailable`: best-effort capability check (Linux + `dbus-send` binary + system D-Bus socket), exposed in `getInfos()` as `host_power_management_available`.
- `POST /api/v1/system/reboot` and `POST /api/v1/system/shutdown-host` (authenticated + admin). The command is awaited so failures are returned to the client.
**Frontend** (Settings → System)
- New "Reboot / Shutdown host" card with a **two-step confirmation** (anti-misclick).
- Buttons are **disabled with a tooltip** when the capability is unavailable, and the server error message is surfaced on failure.
- Reboot button is orange (`btn-warning`), Shutdown is red (`btn-danger`), matching the app's button conventions.
- i18n: en / fr / de.
**Docker**
- Install the `dbus` package in `docker/Dockerfile` and `docker/Dockerfile.buildx`.
- Requires the host D-Bus socket mounted: `-v /run/dbus:/run/dbus:ro` (documented in the v4-website PR).
**Behaviour on a standard install**: after a **reboot** the Gladys container comes back thanks to `--restart=always`; after a **shutdown** the machine stays off until powered on manually. If the host is not systemd-based or the socket isn't mounted, the buttons stay disabled.
**Tests**: unit tests for the two host-power functions (D-Bus command + failure propagation), the capability check (Linux/binary/socket matrix), and the two new controller endpoints.
_Screenshots to be added._
## Summary by CodeRabbit
* **New Features**
* Added administrator host power controls in System Settings (reboot and shutdown) with two-step confirmations.
* Added success/error feedback and clear messaging when host power actions are unavailable.
* Added host power availability detection to automatically disable the controls when unsupported.
* Added English, French, and German translations for the host power UI.
* **Bug Fixes**
* Improved user-facing error reporting when host power commands cannot be issued.
* **Chores**
* Updated container images to include the system tooling required for host power requests.
Gracias por la PR
Te he hecho una revisión :
master ← callemand:feature/reboot-shutdown-host
ouvert 02:42PM - 24 Jul 26 UTC
### Pull Request check-list
To ensure your Pull Request can be accepted as fast… as possible, make sure to review and check all of these items:
- [x] If your changes affect the code, did you write the tests?
- [x] Are server tests passing with coverage? (`cd server && npm run coverage`) — Codecov requires **100% coverage on lines changed in this PR** _(the new functions `rebootHost`/`shutdownHost`/`isHostPowerManagementAvailable` are at 100%; the new controller handlers and the added `getInfos` line are covered too)_
- [x] Did Cypress E2E tests pass? (`npm run cypress:run` from repo root, if UI changed) _(left to CI)_
- [x] Is the linter passing? (`npm run eslint` on both front/server)
- [x] Did you run prettier? (`npm run prettier` on both front/server)
- [x] If you are adding a new feature/service, did you run the integration comparator? (`npm run compare-translations` on front) — en/fr/de complete
- [x] Did you test this pull request in real life? With real devices? _(AMD64 test image being built for a real x86_64 host running systemd)_
- [x] If your changes modify the API (REST or Node.js), did you modify the API documentation? (apidoc `@api` comments added for the two new endpoints)
- [x] If you are adding a new features/services which needs explanation, did you modify the user documentation? See https://github.com/GladysAssistant/v4-website — done in `feature/reboot-shutdown-host-docs` (EN + FR)
- [ ] Did you add fake requests data for the demo mode (`front/src/config/demo.js`)? _N/A — no new device/service data, only two admin actions_
NOTE: these things are not required to open a PR and can be done afterwards / while the PR is open.
### Description of change
Adds the ability to **reboot or shut down the host machine** running Gladys (Raspberry Pi, mini-PC…) directly from the **Settings → System** page — a frequently requested feature ([forum](https://community.gladysassistant.com/t/demande-de-mise-en-place-dun-bouton-arret-et-redemarrage-du-raspberry/6786)).
Until now `system.shutdown()` only stopped the Gladys process; there was no way to power off / reboot the underlying host.
**Mechanism.** The two actions talk to `systemd-logind` over the host **system D-Bus socket** (`org.freedesktop.login1` → `Reboot` / `PowerOff`, non-interactive), via `dbus-send`. No new npm dependency; the `dbus` package is added to both Docker images so `dbus-send` is present.
**Backend**
- `system.rebootHost` / `system.shutdownHost`: call systemd-logind through D-Bus.
- `system.isHostPowerManagementAvailable`: best-effort capability check (Linux + `dbus-send` binary + system D-Bus socket), exposed in `getInfos()` as `host_power_management_available`.
- `POST /api/v1/system/reboot` and `POST /api/v1/system/shutdown-host` (authenticated + admin). The command is awaited so failures are returned to the client.
**Frontend** (Settings → System)
- New "Reboot / Shutdown host" card with a **two-step confirmation** (anti-misclick).
- Buttons are **disabled with a tooltip** when the capability is unavailable, and the server error message is surfaced on failure.
- Reboot button is orange (`btn-warning`), Shutdown is red (`btn-danger`), matching the app's button conventions.
- i18n: en / fr / de.
**Docker**
- Install the `dbus` package in `docker/Dockerfile` and `docker/Dockerfile.buildx`.
- Requires the host D-Bus socket mounted: `-v /run/dbus:/run/dbus:ro` (documented in the v4-website PR).
**Behaviour on a standard install**: after a **reboot** the Gladys container comes back thanks to `--restart=always`; after a **shutdown** the machine stays off until powered on manually. If the host is not systemd-based or the socket isn't mounted, the buttons stay disabled.
**Tests**: unit tests for the two host-power functions (D-Bus command + failure propagation), the capability check (Linux/binary/socket matrix), and the two new controller endpoints.
_Screenshots to be added._
## Summary by CodeRabbit
* **New Features**
* Added administrator host power controls in System Settings (reboot and shutdown) with two-step confirmations.
* Added success/error feedback and clear messaging when host power actions are unavailable.
* Added host power availability detection to automatically disable the controls when unsupported.
* Added English, French, and German translations for the host power UI.
* **Bug Fixes**
* Improved user-facing error reporting when host power commands cannot be issued.
* **Chores**
* Updated container images to include the system tooling required for host power requests.
Puedes pedirle a Claude que me responda
¡Hola a todos!
Este tema ahora está en desarrollo .
Se ha abierto una PR para añadir los botones de parada y reinicio del host en la configuración del Sistema:
master ← claude/resolve-pr-2709-conflicts-fvymxg
ouvert 12:07PM - 24 Aug 26 UTC
### Description
Conflict-resolution branch for #2709 (`callemand:feature/reboot… -shutdown-host`), which had become `dirty` against `master`. This branch is the PR's head merged with the current `master`, with the conflict resolved — the feature itself is unchanged from #2709.
**The conflict**: `front/src/routes/settings/settings-system/SettingsSystemPage.jsx`. Since #2709 was opened, `master` reorganized the System settings page into two thematic columns (system & maintenance on the left — updates, containers, logs, database upkeep; behavior preferences on the right) and added `SettingsSystemKeepDeviceHistory` / `SettingsSystemTimeExpiryState`. #2709 had added its `SettingsSystemHostPower` card to the old flat list.
**Resolution**: keep `master`'s two-column layout intact, and place the host power card at the end of the left (system & maintenance) column, where it belongs thematically. No other file conflicted; the server-side changes (`system.rebootHost` / `system.shutdownHost` / `detectHostPowerManagement`, the two API routes, `getInfos()` fields) merged cleanly.
Verification on the merged tree:
- `npx eslint` on the touched server and front files: no errors (5 pre-existing warnings from #2709, unchanged).
- Prettier: both touched front files match the project style.
- Server tests for the affected areas (`test/lib/system`, `test/controllers/system`): 259 passing.
- `npm run compare-translations` on front: en / fr / de complete.
- `npm run build` on front: succeeds.
If the contributor would rather land the resolution on their own branch, this merge commit can be pushed to `callemand:feature/reboot-shutdown-host` instead and this PR closed.
## Forum
Forum: https://community.gladysassistant.com/t/demande-de-mise-en-place-dun-bouton-arret-et-redemarrage-du-raspberry/6786
### Checklist
- [x] Tests pass: the system lib and controller suites pass on the merged tree (full `npm run coverage` and Cypress left to CI)
- [x] Linter and prettier pass on both front and server
- [x] No undocumented breaking change
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01VrJCRi9if1kC9DVmDcS8sb
---
_Generated by [Claude Code](https://claude.ai/code/session_01VrJCRi9if1kC9DVmDcS8sb)_
## Summary by CodeRabbit
* **New Features**
* Added host reboot and shutdown controls to System Settings.
* Actions now require confirmation and show localized success, error, and unavailable-state messages.
* Availability is detected automatically and displayed based on system support.
* Added English, German, and French translations.
* **Bug Fixes**
* Improved handling of delayed responses and connection loss during power actions.
* Preserved orange button colors in dark mode.
* **Tests**
* Added coverage for power-management detection, execution, error handling, and user-facing controls.
No dudéis en seguir la PR, probar (opcional, sobre todo para pequeñas solicitudes) y dar vuestros comentarios aquí si es necesario.
@Lokkye lo he probado en mi producción y me sale este mensaje:
Tengo una instalación clásica (el mismo docker run que en el sitio web), por lo que representa bien al usuario medio de Gladys
PD: he lanzado Fable sobre ello