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
This commit is contained in:
p0wer 2023-02-15 14:11:54 +01:00 committed by GitHub
parent fea020da5b
commit 4a11e0c6c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,6 +31,14 @@ if [ "$(systemctl is-active systemd-resolved)" = 'inactive' ]; then
systemctl start systemd-resolved.service> /dev/null 2>&1; systemctl start systemd-resolved.service> /dev/null 2>&1;
fi 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 # Enable and start systemd-journal-gatewayd
if [ "$(systemctl is-active systemd-journal-gatewayd.socket)" = 'inactive' ]; then if [ "$(systemctl is-active systemd-journal-gatewayd.socket)" = 'inactive' ]; then
info "Enable systemd-journal-gatewayd" info "Enable systemd-journal-gatewayd"