Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #224778

Network services fail on startup

From Ross Boylan <rossboylan@stanfordalumni.org>
Newsgroups linux.debian.user
Subject Network services fail on startup
Date 2020-07-14 03:50 +0200
Message-ID <AsieZ-7il-1@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

I am having intermittent problems on startup in which network services do
not start properly, generally with messages suggesting the network
interface they need is not available. If I stop and start them after, they
will run.  I suspect this is a result of the interaction of systemd,
ifupdown, and a pre-up script that takes a while to execute.  But if I look
at things now it seems the dependencies in place should suffice.  Of
course, this is after I restarted it, and so perhaps the dependency is
added dynamically, too late to do any good.

I think what I need is for network-online.target not to be ready until
after the interfaces ifup controls are up, but I'm not sure how to do it.
Also not sure it's the problem, particularly since some information
indicates it already has such a dependency.

Details:

My main interface is controlled by /etc/network/interfaces that includes
allow-hotplug /enp*
iface enp5s0 inet static
   # etc

The interface has a pre-up script that has over 1,000 iptables add lines
for blacklists, and I suspect this is slowing things down enough to cause
trouble.  I was not having problems when the script was shorter.

This is a problem other have encountered:
https://unix.stackexchange.com/questions/209832/debian-systemd-network-online-target-not-working
https://unix.stackexchange.com/questions/257888/systemd-wait-for-network-interface-to-be-up-before-running-service

Various solutions are suggested, with a leading one being a dependency on
network-online.target.  But all my network services already have that
dependency.  For example,
# systemctl cat tftpd-hpa
# /run/systemd/generator.late/tftpd-hpa.service
# Automatically generated by systemd-sysv-generator

[Unit]
Documentation=man:systemd-sysv-generator(8)
SourcePath=/etc/init.d/tftpd-hpa
Description=LSB: HPA's tftp server
Before=multi-user.target
Before=multi-user.target
Before=multi-user.target
Before=graphical.target
After=remote-fs.target
After=network-online.target
Wants=network-online.target

tftpd-hpa is the service that fails most consistently.

# systemctl list-dependencies tftpd-hpa
Mon 13 Jul 2020 02:42:22 PM PDT
tftpd-hpa.service
● ├─system.slice
● ├─network-online.target
● │ ├─networking.service
● │ └─NetworkManager-wait-online.service
● └─sysinit.target
etc.
Notably absent from network-online.target's dependencies is anything
related to ifup.
However, ifup@enp5s0.service appears as an After dependency of
network-online.target when viewed another way:
# systemctl show network-online.target
Id=network-online.target
Names=network-online.target
Wants=NetworkManager-wait-online.service networking.service
WantedBy=tftpd-hpa.service nmbd.service hddtemp.service docker.service
mythtv-backend.service exim4.service hylafax.service smbd.service
inetd.service isc-dhcp-server.service
Conflicts=shutdown.target
Before=hylafax.service isc-dhcp-server.service smbd.service exim4.service
apt-daily.service rc-local.service apt-daily-upgrade.service
mythtv-backend.service apcupsd.service tftpd-hpa.service docker.service
inetd.service hddtemp.service shutdown.target nmbd.service
After=ifup@enp5s0.service network.target networking.service
NetworkManager-wait-online.service
Documentation=man:systemd.special(7)
https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget
Any suggestions?
Ideally I would not be tied to the interface name, so that if I plug the
network cable into another port things will still work.

Thanks.
Ross Boylan

Back to linux.debian.user | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Network services fail on startup Ross Boylan <rossboylan@stanfordalumni.org> - 2020-07-14 03:50 +0200
  Re: Network services fail on startup Andrei POPESCU <andreimpopescu@gmail.com> - 2020-07-14 08:50 +0200
  Re: Network services fail on startup Andrei POPESCU <andreimpopescu@gmail.com> - 2020-07-14 08:50 +0200
    Re: Network services fail on startup Dan Ritter <dsr@randomstring.org> - 2020-07-14 13:20 +0200
      Re: Network services fail on startup Andrei POPESCU <andreimpopescu@gmail.com> - 2020-07-14 19:10 +0200
        Re: Network services fail on startup Dan Ritter <dsr@randomstring.org> - 2020-07-14 19:30 +0200
  Re: Network services fail on startup deloptes <deloptes@gmail.com> - 2020-07-14 09:40 +0200
  Re: Network services fail on startup Greg Wooledge <wooledg@eeg.ccf.org> - 2020-07-14 13:40 +0200
    Re: Network services fail on startup Ross Boylan <rossboylan@stanfordalumni.org> - 2020-07-15 00:30 +0200
      Re: Network services fail on startup Ross Boylan <rossboylan@stanfordalumni.org> - 2020-07-16 02:40 +0200

csiph-web