ucollect flow plugin not sending data to uplink
This is to document a conversation I've been having with Josef. I noticed that in recent versions of TurrisOS (I'm on 3.10.4 but this has been going on with other 3.10.x versions), that the ucollect client's flow plugin fails to send data to the server. To reproduce, you reboot the router, and approximately 30 minutes later (the current timeout for ucollect data send), you get a message in /var/log/messages saying:
2018-08-15 19:17:18 info ucollect[4812]: Sending 0 flows
even though by that point there should be data to send. This message repeats every 30 minutes. As a result the data shown at https://project.turris.cz ends up quite inaccurate. Oddly, if you manually restart ucollect after the router finishes booting, this problem doesn't occur. In TurrisOS 3.10.4 the ucollect init was moved later in the boot sequence to try to address this ( https://gitlab.labs.nic.cz/turris/turris-os-packages/blob/b814dcd14da489b062d5854a290325331b82bc9f/net/ucollect-prog/files/ucollect.init ) but this didn't fix the issue.
The problem seems to be the recent rewrite of the ucollect init scripts to use procd init. When I reverted the init script to the last one that used the old-style init ( https://gitlab.labs.nic.cz/turris/turris-os-packages/blob/0937b855692b08254168afe5bbd4febbab39c8f3/net/ucollect-prog/files/ucollect.init ) and rebooted the router, the problem no longer occurred.
Unfortunately I don't know enough about how the OpenWRT init system works to fix this myself, but I'm hoping someone who does can look at it.