[systemd-devel] Ordering services issue. Trying to start ptp4l in bonding setup fails as bonding appears to take a while.

Brian Hutchinson b.hutchman at gmail.com
Thu Dec 2 15:41:52 UTC 2021


Hey James,

On Thu, Dec 2, 2021 at 9:30 AM James Feeney <james at nurealm.net> wrote:

> On 12/1/21 13:27, Brian Hutchinson wrote:
> > Maybe I'm missing something here but I don't see any way for me to "add
> targets" to this problem to solve it ...
>
> Well, of course, that's a problem.  Maybe you can take the construction
> step by step.
>
> First, do you have *five* different unit files, the three different
> service files and the two target files?
>
> Second, reviewing your service file, we see references to
> "systemd-networkd".  That suggests some confusion.
>
> "systemd-networkd" is a systemd hosted network management system, but it
> is NOT the same thing as using systemd AS the network management system.
> They are two completely different things.  Choose one or the other.
>

Yup, I'm using systemd-networkd ... I think I have to in order to leverage
network-online.target etc., and set up my network (bonding in this case)
with .netdev and .network files in /etc/systemd/network.


> If you choose to use systemd-networkd, I cannot help you, and you are left
> to appeal to the systemd-networkd developers.  Personally, this was the
> circumstance that I very much wanted to avoid, and is the motivation for
> using systemd directly, instead of systemd-networkd, or any other "canned"
> network management systems.  When those systems break, you get to keep both
> pieces.
>
> If you choose to use systemd directly as the network management system,
> then you may have to build the system one step at a time.  And if, in fact,
> there is some function needed that is fundamentally missing from systemd
> itself, that is a systemd bug that should be addressed specifically.  For

What kind of platform are you on?  PC, embedded?  Can you give an example
of what this would look like?

now, I don't know that that is the case here.  Still, I have not tried yet
> to understand exactly what you mean by "use carrier state".
>

 https://www.freedesktop.org/software/systemd/man/networkctl.html# shows
operational states but I can also check carrier of my interfaces by:

/sys/bus/i2c/devices/0-005f/net/lan1/carrier
/sys/bus/i2c/devices/0-005f/net/lan2/carrier
/sys/devices/virtual/net/bond1/carrier


> But, there is another problem.  It is not quite clear to me what your
> issue is here.  On the one hand, you are asking about network bonding, and
> on the the other, you are referencing the Precision Time Protocol Boundary
> Clock and Ordinary Clock client service, ptp4l.
>
> Are you having a problem with network bonding?  Or a problem with your
> ptp4l?
>

PTP just happens to be the service I'm trying to start after the bonding is
set up ... it could be any service, so my issue isn't with PTP.  My issue
is with systemd starting PTP before the bond is fully set up.  I've been
doing a lot more playing around and I've gained a little bit of ground.  I
decided to override the default behavior of
systemd-networkd-wait-online.service.  I changed ExecStart to
ExecStart=/lib/systemd/systemd-networkd-wait-online
--interface=bond1:degraded-carrier:carrier which results in 'Invalid
operational state 'degraded-carrier:carrier' but if I just use
--interface=bond1:degraded-carrier it appears to work and PTP gets started
properly without me having to play tricks with services restarting etc..
So now trying to figure out what is wrong with my [:MIN_STATE[:MAX_STATE]]
for --interface=

Regards,

Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20211202/f4727e52/attachment.htm>


More information about the systemd-devel mailing list