Enter console if data partition is missing (#1055)

In case the data partition is missing avoid using the Docker command.
The Docker command triggers a socket activation, which in turn makes
systemd wait for the data partition. This blocks entry into the shell
forever.

Just enter the shell in case data partition is not mounted.
This commit is contained in:
Stefan Agner 2020-12-03 20:29:07 +01:00 committed by GitHub
parent 46bb12844f
commit 2cc78abe56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,6 +10,11 @@ if [ "${TERM}" = "vt220" ] || [ "${TERM}" = "vt102" ] || \
fi fi
# Run CLI container # Run CLI container
if [ ! "$(findmnt /mnt/data)" ]; then
echo "[WARN] Data partition not mounted! Jump into emergency console..."
exec /bin/ash -l
fi
if [ "$(docker ps -q -f name=hassio_cli)" ]; then if [ "$(docker ps -q -f name=hassio_cli)" ]; then
docker container exec \ docker container exec \
-ti hassio_cli \ -ti hassio_cli \
@ -21,7 +26,7 @@ if [ "$(docker ps -q -f name=hassio_cli)" ]; then
fi fi
else else
echo "[WARN] Home Assistant CLI is not running! Jump into emergency console..." echo "[WARN] Home Assistant CLI is not running! Jump into emergency console..."
/bin/ash -l exec /bin/ash -l
fi fi
exit exit