1
0
mirror of https://github.com/home-assistant/operating-system.git synced 2026-05-03 23:18:02 +01:00

Improve UX of HA CLI wrapper and emergency console (#4326)

* Improve UX of HA CLI wrapper and emergency console

For many users, the emergency console gives feeling that the system is
completely broken. However, there are various cases when the system just takes
just a bit longer to start up and the emergency message is shown, while it
finishes a proper startup shortly after. This change tries to improve the UX in
several ways:

* The limit before a forced emergency console startup is changed to 3 minutes
* Waiting can be interrupted with Ctrl+C (reset counter is cleared then)
* Some hints what to check have been added before starting the shell
* Also, because if the HA CLI failed for 5 times in a row in quick succession,
  the CLI startup was then not retried anymore and user may have been left with
  a black screen, the restart limits timeouts have been adjusted only to back
  off and never mark the unit as failed

Closes #4273

* Use /bin/sh and printf to silence linter errors
This commit is contained in:
Jan Čermák
2025-10-01 18:23:28 +02:00
committed by GitHub
parent 95b1d22215
commit bde19002df
2 changed files with 43 additions and 9 deletions

View File

@@ -15,6 +15,9 @@ Before=getty.target
Conflicts=rescue.service
Before=rescue.service
# Same value as RestartMaxDelaySec to avoid marking the service as failed
StartLimitIntervalSec=3s
[Service]
# the VT is cleared by TTYVTDisallocate
# The '-o' option value tells agetty to replace 'login' arguments with an
@@ -23,7 +26,9 @@ Before=rescue.service
ExecStart=/usr/sbin/hassos-cli
Type=idle
Restart=always
RestartSec=0
RestartSec=100ms
RestartMaxDelaySec=3s
RestartSteps=3
UtmpIdentifier=%I
TTYPath=/dev/%I
TTYReset=yes