diff --git a/setup/start.sh b/setup/start.sh index 28850e668..0d836c8ac 100755 --- a/setup/start.sh +++ b/setup/start.sh @@ -166,22 +166,6 @@ echo "==> Setting up unbound" # We listen on 0.0.0.0 because there is no way control ordering of docker (which creates the 172.18.0.0/16) and unbound echo -e "server:\n\tinterface: 0.0.0.0\n\taccess-control: 127.0.0.1 allow\n\taccess-control: 172.18.0.1/16 allow" > /etc/unbound/unbound.conf.d/cloudron-network.conf -# The default ubuntu unbound service uses SysV fallback mode, we want a proper unit file so unbound gets restarted correctly -cat > "/etc/systemd/system/unbound.service" < Adding systemd services" cp -r "${script_dir}/start/systemd/." /etc/systemd/system/ systemctl daemon-reload diff --git a/setup/start/systemd/unbound.service b/setup/start/systemd/unbound.service new file mode 100644 index 000000000..48057d5d5 --- /dev/null +++ b/setup/start/systemd/unbound.service @@ -0,0 +1,14 @@ +# The default ubuntu unbound service uses SysV fallback mode, we want a proper unit file so unbound gets restarted correctly + +[Unit] +Description=Unbound DNS Resolver +After=network.target + +[Service] +PIDFile=/run/unbound.pid +ExecStart=/usr/sbin/unbound -d +ExecReload=/bin/kill -HUP $MAINPID +Restart=always + +[Install] +WantedBy=multi-user.target