|
@@ -316,14 +316,25 @@ local function start_ubus_listen()
|
|
|
log_info("ubus listen ended")
|
|
log_info("ubus listen ended")
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
- -- Run ubus listen in background thread
|
|
|
|
|
- luv.new_task(function()
|
|
|
|
|
- ubus_listen_loop()
|
|
|
|
|
- end)
|
|
|
|
|
|
|
+ -- Run ubus listen in background (forked process)
|
|
|
|
|
+ -- Use shell fork to run in background
|
|
|
|
|
+ os.execute("ubus listen dhcp ipv4leases network.interface.* hostapd.* 2>&1 &>/dev/null & true")
|
|
|
|
|
|
|
|
return true
|
|
return true
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
|
|
+-- Alternative: simple fork without luv.new_task
|
|
|
|
|
+local function start_ubus_fork()
|
|
|
|
|
+ log_info("Starting ubus listen in background...")
|
|
|
|
|
+
|
|
|
|
|
+ -- Fork ubus listen to background
|
|
|
|
|
+ local pid = io.popen("nohup ubus listen dhcp ipv4leases network.interface.* hostapd.* 2>&1 &", "w")
|
|
|
|
|
+ if pid then pid:close() end
|
|
|
|
|
+
|
|
|
|
|
+ log_info("ubus listen forked to background")
|
|
|
|
|
+ return true
|
|
|
|
|
+end
|
|
|
|
|
+
|
|
|
-- ============================================================================
|
|
-- ============================================================================
|
|
|
-- MAIN
|
|
-- MAIN
|
|
|
-- ============================================================================
|
|
-- ============================================================================
|