[systemd-devel] Waiting for network routes to appear

Lennart Poettering mzerqung at 0pointer.de
Mon Jul 4 08:51:27 UTC 2022


On Mi, 15.06.22 07:31, Kevin P. Fleming (kevin at km6g.us) wrote:

> I've got a number of systems that use BIRD to learn the routes
> available on their networks, and as a result some services on those
> systems attempt to start up before the routes have been learned. If
> those services attempt to make network connections (even just DNS
> queries), they will fail, and that's unpleasant.
>
> I can't use existing systemd facilities to make these services wait,
> because there's no mechanism available for BIRD to indicate that any
> specific route has been learned, or a way to configure a service to
> wait for a specific route.
>
> I'm considering just writing a smallish Python program which will
> accept (via configuration) a list of routes, and will listen to
> netlink to wait for all of those routes to appear. I'd then make my
> services dependent on this service reporting success. However, since
> networkd already listens to netlink, it would certainly be possible
> for it to provide this facility in some way.
>
> If you'll pardon the analogy, I'm thinking of something like
> RequiresMountsFor=, which makes service startup wait until mount units
> have succeeded. Of course following this analogy we'd end up creating
> the concept of a 'route unit', and I'm not sure that's really the
> right thing to do here.
>
> Is it worth trying to design some way for networkd to provide this
> facility? if not, I'll just continue down the road of doing this
> outside of systemd proper.

networkd manages an interface in full or not at all. I am pretty sure
we shouldn't make it something that watches asynchronously what other
software does, and then acts on it. That's racy and fragile.

It appears to me you should ask the "bird" project for this
functionalit instead?

Lennart

--
Lennart Poettering, Berlin


More information about the systemd-devel mailing list