1
0
mirror of https://github.com/home-assistant/operating-system.git synced 2026-02-21 18:29:02 +00:00
Files
Jan Čermák bde19002df 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
2025-10-01 18:23:28 +02:00

45 lines
1.2 KiB
Desktop File

[Unit]
Description=Home Assistant CLI
Wants=hassos-supervisor.service
After=systemd-user-sessions.service plymouth-quit-wait.service getty-pre.target hassos-supervisor.service
Conflicts=getty@%i.service
# If additional gettys are spawned during boot then we should make
# sure that this is synchronized before getty.target, even though
# getty.target didn't actually pull it in.
Before=getty.target
# IgnoreOnIsolate causes issues with sulogin, if someone isolates
# rescue.target or starts rescue.service from multi-user.target or
# graphical.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
# option to preserve environment (-p), followed by '--' for safety, and then
# the entered username.
ExecStart=/usr/sbin/hassos-cli
Type=idle
Restart=always
RestartSec=100ms
RestartMaxDelaySec=3s
RestartSteps=3
UtmpIdentifier=%I
TTYPath=/dev/%I
TTYReset=yes
TTYVHangup=yes
TTYVTDisallocate=yes
IgnoreSIGPIPE=no
SendSIGHUP=yes
StandardInput=tty-force
StandardOutput=inherit
StandardError=inherit
[Install]
WantedBy=multi-user.target