aboutsummaryrefslogtreecommitdiff
path: root/net/dawn/files/dawn.init
diff options
context:
space:
mode:
authorNick Hainke <vincent@systemli.org>2020-04-14 11:49:33 +0200
committerNick Hainke <vincent@systemli.org>2020-04-15 21:48:25 +0200
commit802f7ef0ec2b9fafb4fa5c7534b72f29c126b811 (patch)
tree456d2b59afcb5cf833cf236165a15902c8eb8ee3 /net/dawn/files/dawn.init
parentd917d662aedd9c133217b5c6d8c5a4f4a6bd3dea (diff)
dawn: fix reboot
DAWN has a race condition with umdns that prevents dawn from surviving a reboot. Increase procd start and stop of dawn to 81. Further, network is sometimes not ready. Add utimer to check if socket binds correctly. Signed-off-by: Nick Hainke <vincent@systemli.org>
Diffstat (limited to 'net/dawn/files/dawn.init')
-rwxr-xr-xnet/dawn/files/dawn.init21
1 files changed, 17 insertions, 4 deletions
diff --git a/net/dawn/files/dawn.init b/net/dawn/files/dawn.init
index bccca669b..626b12fe5 100755
--- a/net/dawn/files/dawn.init
+++ b/net/dawn/files/dawn.init
@@ -1,13 +1,26 @@
#!/bin/sh /etc/rc.common
-
+
USE_PROCD=1
-START=50
-STOP=50
+START=81
+STOP=81
PROG=/usr/sbin/dawn
NAME=dawn
+wait_for_network()
+{
+ ubus -t 15 wait_for network.interface.$1 2>/dev/null
+}
+
+boot()
+{
+ ubus -t 5 wait_for umdns 2>/dev/null
+ config_load network
+ config_foreach wait_for_network interface
+ rc_procd start_service
+}
+
reload_service()
{
if service_running; then
@@ -30,7 +43,7 @@ start_service()
config_get _tcp_buffer "$1" tcp_port
}
config_foreach load_tcp_port network
-
+
touch /tmp/dawn_mac_list
echo "Starting Service..."