]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
unbound: Start unbound when invoked by DHCP scripts
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 1 Oct 2016 17:52:07 +0000 (18:52 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 1 Oct 2016 17:52:07 +0000 (18:52 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/initscripts/init.d/networking/red.up/05-update-dns-forwarders

index 7f35696f58766487472d9ac9b50bfaf7317246c0..be8879ca9e1ce3220a63086f984705d4ac52720e 100644 (file)
@@ -1,4 +1,12 @@
 #!/bin/bash
 
-# Update DNS forwarders for unbound
-exec /etc/init.d/unbound update-forwarders
+# If network has not fully been brought up here, we start unbound
+# so that all following scripts can rely on DNS resolution
+
+# Update DNS forwarders if unbound is running
+if pgrep -q unbound; then
+       exec /etc/init.d/unbound update-forwarders
+fi
+
+# Start unbound if it is not running, yet
+exec /etc/init.d/unbound start