dawn: fix reboot 11841/head
authorNick Hainke <vincent@systemli.org>
Tue, 14 Apr 2020 09:49:33 +0000 (11:49 +0200)
committerNick Hainke <vincent@systemli.org>
Wed, 15 Apr 2020 19:48:25 +0000 (21:48 +0200)
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>
net/dawn/Makefile
net/dawn/files/dawn.init

index 01d5bf273b4f7e5942db751ec47b2b30f7b6480c..69754883b13c2570e2b1776a9030cf0b1b5650c9 100644 (file)
@@ -5,13 +5,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dawn
-PKG_SOURCE_DATE:=2020-04-10
+PKG_SOURCE_DATE:=2020-04-15
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/berlin-open-wireless-lab/DAWN.git
-PKG_SOURCE_VERSION:=5709b96a4dc156ffc8e846360c6d3ecc6584605b
-PKG_MIRROR_HASH:=c1d080eb8ae1d9ee07ebcf91e0a1e7c731875b142ebf838a75043c197fec4c37
+PKG_SOURCE_VERSION:=899eae05f009091bab4c56237e65b0ffb60b3760
+PKG_MIRROR_HASH:=943132c0f2808501f399ec937d6cf25b86aa8da626813c011fa531d5ad2621a8
 
 PKG_MAINTAINER:=Nick Hainke <vincent@systemli.org>
 PKG_LICENSE:=GPL-2.0-only
index bccca669b2ad04ccf71207a7dcbae862a1f82670..626b12fe587fda4166548d15a82ea1af91a4d5ca 100755 (executable)
@@ -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..."