Skip to content

Conversation

@aanderse
Copy link
Contributor

The netlink plugin only receives RTM_NEWLINK events for interfaces that appear after the plugin starts. Interfaces that already exist at boot (e.g., virtio-net in QEMU) never generate events, so their conditions like net/eth0/exist were never set.

Moving enumeration to PLUGIN_INIT doesn't work because it runs before cond_init(), so the condition filesystem isn't ready yet.

Fix by registering an HOOK_SVC_PLUGIN callback that queries existing interfaces and routes. This hook runs during conf_init(), after the condition system is initialized.


i recently added ifupdown-ng to my home server and decided this would be a reasonable conditions set: <service/syslogd/ready,net/eth0/exist> - everything worked great 👍

when i made my qemu vm tests depend on the same ifupdown-ng configuration they failed because net/eth0/exist never came up. i did a little research and then asked claude to help me out on this... the patch seemed reasonable, makes sense enough to me, works on my home server, and now my qemu vm tests pass

does this seem reasonable to you @troglobit?

The netlink plugin only receives RTM_NEWLINK events for interfaces that
appear after the plugin starts.  Interfaces that already exist at boot
(e.g., virtio-net in QEMU) never generate events, so their conditions
like net/eth0/exist were never set.

Moving enumeration to PLUGIN_INIT doesn't work because it runs before
cond_init(), so the condition filesystem isn't ready yet.

Fix by registering an HOOK_SVC_PLUGIN callback that queries existing
interfaces and routes.  This hook runs during conf_init(), after the
condition system is initialized.
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.

1 participant