[systemd-devel] Starting a service before any networking
Silvio Knizek
killermoehre at gmx.net
Wed Sep 27 10:30:59 UTC 2023
Am Mittwoch, dem 27.09.2023 um 10:31 +0100 schrieb Mark Rogers:
> On Wed, 27 Sept 2023 at 10:18, Mantas Mikulėnas <[grawity at gmail.com](mailto:grawity at gmail.com)> wrote:
>
> > So now I'm curious: if the first command you run is to bring the interface *down*, then what exactly brought it up?
>
>
> Good question. The reason for down/up was that this was working as a way to reset the connection after boot, so I just transferred that to the ExecStartPre.
>
> Looking at the "journalctl -u dhcpcd" output, this is what I see from my last boot:
> Feb 14 10:12:05 pi systemd[1]: Starting dhcpcd on all interfaces...
> Feb 14 10:12:05 pi ip[372]: 2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
> Feb 14 10:12:05 pi ip[372]: link/ether b8:27:eb:0d:ee:bb brd ff:ff:ff:ff:ff:ff
> Feb 14 10:12:05 pi ip[383]: 2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
> Feb 14 10:12:05 pi ip[383]: link/ether b8:27:eb:0d:ee:bb brd ff:ff:ff:ff:ff:ff
> Feb 14 10:12:06 pi dhcpcd[385]: wlan0: starting wpa_supplicant
> Feb 14 10:12:36 pi dhcpcd[385]: timed out
> Feb 14 10:12:36 pi systemd[1]: Started dhcpcd on all interfaces.
> Feb 14 10:12:37 pi systemd[1]: Stopping dhcpcd on all interfaces...
> Feb 14 10:12:37 pi dhcpcd[519]: sending signal TERM to pid 466
> Feb 14 10:12:37 pi dhcpcd[519]: waiting for pid 466 to exit
> Feb 14 10:12:38 pi systemd[1]: dhcpcd.service: Succeeded.
> Feb 14 10:12:38 pi systemd[1]: Stopped dhcpcd on all interfaces.
> Feb 14 10:12:38 pi systemd[1]: Starting dhcpcd on all interfaces...
> Feb 14 10:12:38 pi ip[524]: 2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
> Feb 14 10:12:38 pi ip[524]: link/ether b8:27:eb:0d:ee:bb brd ff:ff:ff:ff:ff:ff
> Feb 14 10:12:38 pi ip[529]: 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
> Feb 14 10:12:38 pi ip[529]: link/ether b8:27:eb:0d:ee:bb brd ff:ff:ff:ff:ff:ff
> Feb 14 10:12:38 pi dhcpcd[530]: wlan0: starting wpa_supplicant
> Feb 14 10:12:49 pi dhcpcd[530]: Too few arguments.
> Feb 14 10:12:49 pi dhcpcd[530]: Too few arguments.
> Feb 14 10:12:49 pi systemd[1]: Started dhcpcd on all interfaces.
>
> (I deleted the "ip addr" output from the interfaces other than eth0 for brevity.)
>
> The interesting thing is surely that dhcpcd is being started twice. Assuming that was always happening then that suggests dhcpcd was bringing the network up early (and failing but leaving it in a "stuck" state) and then again later (where it was unable to recover from the first failure, but now can)?
Why does this sounds like https://github.com/raspberrypi/linux/issues/3195? Maybe you find starting there some more information.
BR
Silvio
More information about the systemd-devel
mailing list