From 4a11e0c6c0d0429365e38be66f66ea529357e734 Mon Sep 17 00:00:00 2001 From: p0wer <2510748+p0wertiger@users.noreply.github.com> Date: Wed, 15 Feb 2023 14:11:54 +0100 Subject: [PATCH] Check and fix systemd socket file As stated in #247 with the default setup the path /run/systemd-journal-gatewayd.sock may be a directory, not a file, we have to fix that --- homeassistant-supervised/DEBIAN/postinst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/homeassistant-supervised/DEBIAN/postinst b/homeassistant-supervised/DEBIAN/postinst index 6ff90de..0e2c0fa 100755 --- a/homeassistant-supervised/DEBIAN/postinst +++ b/homeassistant-supervised/DEBIAN/postinst @@ -31,6 +31,14 @@ if [ "$(systemctl is-active systemd-resolved)" = 'inactive' ]; then systemctl start systemd-resolved.service> /dev/null 2>&1; fi +# Check and fix systemd-journal-gatewayd socket location +if [ ! -S "/run/systemd-journal-gatewayd.sock" ]; then + info "Set up systemd-journal-gatewayd socket file" + if [ "$(systemctl is-active systemd-journal-gatewayd.socket)" = 'active' ]; then + systemctl stop systemd-journal-gatewayd.socket> /dev/null 2>&1; + fi + rm -rf "/run/systemd-journal-gatewayd.sock"; +fi # Enable and start systemd-journal-gatewayd if [ "$(systemctl is-active systemd-journal-gatewayd.socket)" = 'inactive' ]; then info "Enable systemd-journal-gatewayd"