Skip to content

fix(ns-monitoring): start ns-flows before netifyd - #2042

Merged
Tbaile merged 1 commit into
release-8.9.0from
fix/ns-flows-start-order
Nov 25, 2026
Merged

Tbaile merged 1 commit into
release-8.9.0from
fix/ns-flows-start-order

Conversation

@gsanchietti

Copy link
Copy Markdown
Member

At every boot the Deep Packet Inspection agent (netifyd) started before ns-flows, because both used start position 99 and netifyd comes first alphabetically. Its sink-ns-flows plugin then logged 15 to 40 lines of sink-ns-flows: default: http://127.0.0.1:8080/flows: Failed to connect to 127.0.0.1:8080 in the first seconds, and the flows of those seconds were lost. ns-flows now starts at position 98, so it is already listening when netifyd starts.

This only takes effect on new images and fresh installs. A unit that receives the updated ns-monitoring as a package update keeps its old /etc/rc.d/S99ns-flows link, because OpenWrt does not re-run disable/enable on package upgrades, so the boot errors stay there until /etc/init.d/ns-flows disable && /etc/init.d/ns-flows enable is run. The service starts in both cases; only the log noise differs.

How to test

  • Install a new image with Deep Packet Inspection enabled
  • Check that /etc/rc.d contains S98ns-flows and S99netifyd
  • Reboot and run grep -c "sink-ns-flows.*Failed to connect" /var/log/messages: expected 0 (before the change: 15 to 40)
  • Check that curl -s http://127.0.0.1:8080/flows returns flows

Generated by Claude Code:claude-opus-5-5 with nethserver-pr

@gsanchietti gsanchietti self-assigned this Nov 25, 2026
@gsanchietti
gsanchietti changed the base branch from main to release-8.9.0 November 25, 2026 08:55
Both services started at position 99, so netifyd came up first and its
sink-ns-flows plugin logged 15-40 "Failed to connect to 127.0.0.1:8080"
errors at every boot until ns-flows was listening, dropping the flows
of those first seconds.

Assisted-by: Claude Code:claude-opus-5-5
@gsanchietti
gsanchietti force-pushed the fix/ns-flows-start-order branch from 4b853fb to 553848a Compare November 25, 2026 08:56
@gsanchietti
gsanchietti marked this pull request as ready for review November 25, 2026 08:56
@gsanchietti
gsanchietti requested a review from Tbaile November 25, 2026 08:56
@Tbaile
Tbaile merged commit 998efdc into release-8.9.0 Nov 25, 2026
3 checks passed
@Tbaile
Tbaile deleted the fix/ns-flows-start-order branch November 25, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants