[systemd-devel] networkd D-Bus API for link up/down?
Kevin P. Fleming
kevin at km6g.us
Tue Sep 27 15:27:20 UTC 2022
On Thu, Sep 22, 2022 at 12:21 PM Kevin P. Fleming <kevin at km6g.us> wrote:
> For now I will use an OCF-style resource agent (fancy shell script)
> which uses 'networkctl' to do the work, but later I'll consider making
> something more 'native'. My primary motivation for having a 'native'
> RA is reducing the cost (time and CPU) of the regular monitoring
> operations; launching a shell script which sources many files of
> functions and has to parse 'networkctl --json' output is much more
> costly than using an ioctl to check the status of the interface
> directly. It's possible that using 'ip link' instead of 'networkctl'
> will be more efficient, so I may pursue that option too.
I ended up just cloning the existing 'iface-vlan' RA, which uses 'ip'
to do its work, and then modifying it to only manage the state of an
existing interface. It works well in my production testing, and I'm
planning on contributing it to the resource-agents repository in case
anyone else wants to do a similar thing.
More information about the systemd-devel
mailing list