[systemd-devel] Ensuring that a unit starts before any networking

Mark Rogers mark at more-solutions.co.uk
Tue Jun 30 11:59:54 UTC 2020


On Tue, 30 Jun 2020 at 12:13, Simon McVittie <smcv at collabora.com> wrote:
>
> I would have expected this to be done in some "larger" network management
> component that is responsible for bringing up network interfaces according
> to your configuration, rather than necessarily dhcpcd.service itself.

In which case one would expect dhcpcd to depend on that instead; I
can't see any obvious dependencies that would apply but I'm somewhat
out of my depth here.

> You mentioned Raspbian, which is a Debian derivative?

Yes, Raspbian is Debian a derivative.

> Typically server-class systems will use either ifupdown or
> systemd-networkd, which are ideal for relatively static network
> configurations that are set up by a sysadmin.

It's definitely not systemd-networkd, to my untrained eye it looks
like ifupdown is there but how do I confirm?  dhcpcd seems to start
very early in the boot and doesn't seem to be After anything on my
Raspbian box.

networking.service certainly includes After=network-pre.target and
Before=network.target, but dhcpcd also includes Before=network.target
- I can't see any combination of dependencies that would put
dhcpcd.service later than networking.service. It's quite plausible
that the "bug" here isn't necessarily the need for
After=network-pre.target but as far as I can tell it is missing
something.

> If Raspbian does its own thing rather than recycling Debian components
> for this, then it might need a separate bug report.

I don't have a Debian box to check dhcpcd dependencies but I would
assume that they're lifted from Debian, albeit that they may or may
not be default Debian components. I have raised a Raspbian bug, which
references this thread, so I'll see where that takes me.

-- 
Mark Rogers


More information about the systemd-devel mailing list