diff --git a/homeassistant-supervised/DEBIAN/postinst b/homeassistant-supervised/DEBIAN/postinst index f7072a3..fda553e 100755 --- a/homeassistant-supervised/DEBIAN/postinst +++ b/homeassistant-supervised/DEBIAN/postinst @@ -24,13 +24,19 @@ URL_APPARMOR_PROFILE="https://version.home-assistant.io/apparmor.txt" info "Restarting NetworkManager" systemctl restart "${SERVICE_NM}" -# Enable and start systemd-resolved -if [ "$(systemctl is-active systemd-resolved)" = 'inactive' ]; then - info "Enable systemd-resolved" - systemctl enable systemd-resolved.service> /dev/null 2>&1; - systemctl start systemd-resolved.service +# Set permissions of /etc/systemd/resolved.conf +# check if file has correct permissions +if [ "$(stat -c %a /etc/systemd/resolved.conf)" != "644" ]; then + info "Setting permissions of /etc/systemd/resolved.conf" + chmod 644 /etc/systemd/resolved.conf fi +# Enable and restart systemd-resolved +info "Enable systemd-resolved" +systemctl enable systemd-resolved.service> /dev/null 2>&1; +info "Restarting systemd-resolved" +systemctl restart systemd-resolved.service + # Check and fix systemd-journal-gatewayd socket location if [ ! -S "/run/systemd-journal-gatewayd.sock" ]; then info "Set up systemd-journal-gatewayd socket file" diff --git a/homeassistant-supervised/DEBIAN/preinst b/homeassistant-supervised/DEBIAN/preinst index 3896dc5..b229df3 100755 --- a/homeassistant-supervised/DEBIAN/preinst +++ b/homeassistant-supervised/DEBIAN/preinst @@ -64,3 +64,6 @@ dpkg-divert --package homeassistant-supervised --add --rename \ dpkg-divert --package homeassistant-supervised --add --rename \ --divert /etc/network/interfaces.real /etc/network/interfaces + +dpkg-divert --package homeassistant-supervised --add --rename \ + --divert /etc/systemd/resolved.conf.real /etc/systemd/resolved.conf \ No newline at end of file diff --git a/homeassistant-supervised/etc/NetworkManager/NetworkManager.conf b/homeassistant-supervised/etc/NetworkManager/NetworkManager.conf index bc5f0de..343203c 100644 --- a/homeassistant-supervised/etc/NetworkManager/NetworkManager.conf +++ b/homeassistant-supervised/etc/NetworkManager/NetworkManager.conf @@ -16,6 +16,7 @@ connection.llmnr=2 [connectivity] uri=http://checkonline.home-assistant.io/online.txt +interval=600 [device] wifi.scan-rand-mac-address=no \ No newline at end of file diff --git a/homeassistant-supervised/etc/systemd/resolved.conf b/homeassistant-supervised/etc/systemd/resolved.conf new file mode 100644 index 0000000..db934d0 --- /dev/null +++ b/homeassistant-supervised/etc/systemd/resolved.conf @@ -0,0 +1,25 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# Entries in this file show the compile time defaults. +# You can change settings by editing this file. +# Defaults can be restored by simply deleting this file. +# +# See resolved.conf(5) for details + +[Resolve] +#DNS= +#FallbackDNS=1.1.1.1 8.8.8.8 1.0.0.1 8.8.4.4 2606:4700:4700::1111 2001:4860:4860::8888 2606:4700:4700::1001 2001:4860:4860::8844 +#Domains= +DNSSEC=no +DNSOverTLS=no +#MulticastDNS=yes +#LLMNR=yes +#Cache=yes +DNSStubListener=no +#ReadEtcHosts=yes +#ResolveUnicastSingleLabel=no \ No newline at end of file diff --git a/homeassistant-supervised/etc/systemd/system/hassio-supervisor.service b/homeassistant-supervised/etc/systemd/system/hassio-supervisor.service index 39fb77a..1351c4b 100644 --- a/homeassistant-supervised/etc/systemd/system/hassio-supervisor.service +++ b/homeassistant-supervised/etc/systemd/system/hassio-supervisor.service @@ -1,8 +1,8 @@ [Unit] Description=Hass.io supervisor Requires=docker.service dbus.service -Wants=network-online.target hassio-apparmor.service time-sync.target systemd-journal-gatewayd.socket -After=docker.service dbus.service network-online.target hassio-apparmor.service time-sync.target systemd-journal-gatewayd.socket +Wants=network-online.target hassio-apparmor.service time-sync.target systemd-journal-gatewayd.socket systemd-resolved.service +After=docker.service dbus.service network-online.target hassio-apparmor.service time-sync.target systemd-journal-gatewayd.socket systemd-resolved.service StartLimitIntervalSec=60 StartLimitBurst=5 ConditionPathExists=/run/dbus/system_bus_socket