Modifying systemd-networkd-wait-online.service

  • I am having an issue with my setup where the mention service will wait and eventually hang on bootup. I think it is because I have a 10G nic with 2 hosts that are direct attached (static IPs, no gateway, no DNS), but not always powered on. What I believe is happening is the service is waiting for the links to come up, but they don't since the endpoints are down. This causes the service to eventually fail.


    An interesting observation is that the primary interface (a 1g connection that has a static IP in 192.168.150/24) comes up right away, is pingable, I can ssh into it, and I can bring up the web interface here. Other services remain down, however, while wait online is waiting including all the docker networking, smb, and ftp. As soon as the service fails, everything else comes up and the server is fine with the exception of me getting emails saying rrcached and collectd taking too long to start and restarting.


    Removing the direct attached 10G interfaces from OMV (but leaving the nic in and everything) solves this issue and the system comes up fine and the service doesn't hang and fail. Also, this never happened in OMV4, but I guess the new systemd networking in OMV5 is causing this.


    After reading about a bit, I found an option I can add to the systemd-networkd-wait-online.service unit telling it to ignore certain interfaces, or to just pass when any interface is up. My question is what is the best way of doing this in OMV 5? Should I edit the unit file in /etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service directly, or is there an environment variable I should add to /etc/default/openmediavault and re-deploy the salt env?


    If anyone that can verify they are seeing the same thing with interfaces that are waiting for a link, but don't have one on boot it would be great.

    • Offizieller Beitrag

    Should I edit the unit file in /etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service directly, or is there an environment variable I should add to /etc/default/openmediavault and re-deploy the salt env?

    Never touch and modify a file that is installed by a Debian package, in this case systemd. You will run into troubles when the packages installs a newer version of the file.


    Use systemd drop-ins to override the default behavior of a systemd unit. OMV is not responsible for this service, thus you can not use an environment variable to customize things like it is possible for other issues that are under control of OMV.

  • Thanks, I will do some research about how to do this since I am still pretty new to linux and systemd.


    Any way you can see if the behavior I describe is reproducible? Basically bring up the system with one of the defined interfaces not having a link?

  • Okay, I have confirmed the error was indeed due to systemd-networkd-wait-online.service waiting for the 2 10G interfaces to come up, even though in my case they won't always have a link on boot.


    Thank you as always to votdev for pointing me in the right direction. I looked up the man page for systemd-networkd-wait-online.service and made a drop-in like suggested. It solved my issue, so I wanted to document it here in case anyone runs into it.


    All I had to do was create a file, I called it override.conf, and place it in a the appropriate directory (

    /etc/systemd/system/systemd-networkd-wait-online.service.d) in this case; you will probably need to create the directory as well.


    The contents of the override.conf file in my case are:


    Code
    [Service]
    ExecStart=
    ExecStart=/lib/systemd/systemd-networkd-wait-online --ignore=enp2s0f4 --ignore=enp2s0f4d1


    **Note, the first blank "ExecStart=" line is important, it won't work without it. In my case I am telling the service to ignore the state of the 2 listed interfaces. You could also do the inverse if you'd like and tell it to only check a specific interface. Just read through the man page.

  • antsh

    Hat das Label OMV 5.x hinzugefügt.
  • antsh

    Hat das Label gelöst hinzugefügt.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!