Re: [systemd-devel] Starting a service before any networking

2023-09-29 Thread Jetchko Jekov
Actually, I believe the dhcpcd service is the wrong one here: Looking at the dhcpcd.service's Unit section (in F39 at least) I see: [Unit] Description=A minimalistic network configuration daemon with DHCPv4, rdisc and DHCPv6 support Wants=network.target Before=network.target So it orders itself

Re: [systemd-devel] Starting a service before any networking

2023-09-28 Thread Mantas Mikulėnas
On Wed, Sep 27, 2023 at 12:31 PM Mark Rogers wrote: > On Wed, 27 Sept 2023 at 10:18, Mantas Mikulėnas 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

Re: [systemd-devel] Starting a service before any networking

2023-09-28 Thread Mark Rogers
On Thu, 28 Sept 2023 at 11:16, Mark Rogers wrote: > DefaultDependencies=no > FWIW I tried: DefaultDependencies=no Before=network-pre.target Wants=network-pre.target and DefaultDependencies=no Before=network-pre.target Wants=network-pre.target local-fs.target .. and in bo

Re: [systemd-devel] Starting a service before any networking

2023-09-28 Thread Mark Rogers
On Wed, 27 Sept 2023 at 14:09, Jetchko Jekov wrote: > A good example of a service that needs to be started before networking > is the firewall service. > You can take a look at what your distro of choice is providing for hints. > Good idea, thanks > DefaultDependencies=no > This looks like th

Re: [systemd-devel] Starting a service before any networking

2023-09-27 Thread Jetchko Jekov
A good example of a service that needs to be started before networking is the firewall service. You can take a look at what your distro of choice is providing for hints. But essentially it boils down to something like this: Fedora's iptables.service: Before=network-pre.target Wants=network-pre.tar

Re: [systemd-devel] Starting a service before any networking

2023-09-27 Thread Mark Rogers
On Wed, 27 Sept 2023 at 11:31, Silvio Knizek wrote: > Why does this sounds like https://github.com/raspberrypi/linux/issues/3195? > Maybe you find starting there some more information. > I agree it does sound similar. That said I am on a Pi3 (not a Pi4) and later kernel (4.19.97-v7+). But it is

Re: [systemd-devel] Starting a service before any networking

2023-09-27 Thread Silvio Knizek
Am Mittwoch, dem 27.09.2023 um 10:31 +0100 schrieb Mark Rogers: > On Wed, 27 Sept 2023 at 10:18, Mantas Mikulėnas > <[graw...@gmail.com](mailto:graw...@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?

Re: [systemd-devel] Starting a service before any networking

2023-09-27 Thread Mark Rogers
On Wed, 27 Sept 2023 at 10:18, Mantas Mikulėnas 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

Re: [systemd-devel] Starting a service before any networking

2023-09-27 Thread Mantas Mikulėnas
On Wed, Sep 27, 2023 at 12:14 PM Mark Rogers wrote: > On Wed, 27 Sept 2023 at 09:39, Mantas Mikulėnas wrote: > >> It might be an issue with the kernel driver for your Ethernet interface, >> then (as setting the interface 'up/down' usually reinitializes the >> controller) – or possibly a physical

Re: [systemd-devel] Starting a service before any networking

2023-09-27 Thread Mark Rogers
On Wed, 27 Sept 2023 at 09:39, Mantas Mikulėnas wrote: > It might be an issue with the kernel driver for your Ethernet interface, > then (as setting the interface 'up/down' usually reinitializes the > controller) – or possibly a physical issue with your cable or your switch, > but it doesn't seem

Re: [systemd-devel] Starting a service before any networking

2023-09-27 Thread Mantas Mikulėnas
On Wed, Sep 27, 2023 at 11:23 AM Mark Rogers wrote: > On Tue, 26 Sept 2023 at 20:41, Mark Rogers > wrote: > >> (I should be able to find another Pi to test for any physical hardware >> issues, I'll try that tomorrow.) >> > > I have today tested on a different Pi, different PSU, different cable,

Re: [systemd-devel] Starting a service before any networking

2023-09-27 Thread Jan Hugo Prins
I think the main problem you are running into is the DefaultDependencies option. When this is set to on, several default dependencies are being enforced which make sure that at least a basic system is up and running before anything else is started. When you want to start something before the ba

Re: [systemd-devel] Starting a service before any networking

2023-09-27 Thread Mark Rogers
On Tue, 26 Sept 2023 at 20:41, Mark Rogers wrote: > (I should be able to find another Pi to test for any physical hardware > issues, I'll try that tomorrow.) > I have today tested on a different Pi, different PSU, different cable, all with exactly the same results. There is definitely something

Re: [systemd-devel] Starting a service before any networking

2023-09-26 Thread Demi Marie Obenour
On Tue, Sep 26, 2023 at 11:50:55AM +0100, Mark Rogers wrote: > I'm sure this is trivial but I've gone round in circles without success. > > I have a script which reads from an SQLite database and generates various > system configuration files - at the moment these are dhcpcd.conf and > wpa_supplic

Re: [systemd-devel] Starting a service before any networking

2023-09-26 Thread Mark Rogers
On Tue, 26 Sept 2023 at 19:38, Mantas Mikulėnas wrote: > That's not a race condition; it's a fault in the network interface > itself. "NO-CARRIER" means it's physically unable to establish the > Ethernet link – an external condition that the service ordering has no > effect on. > That's interest

Re: [systemd-devel] Starting a service before any networking

2023-09-26 Thread Mantas Mikulėnas
On 2023-09-26 21:31, Mark Rogers wrote: On Tue, 26 Sept 2023 at 13:44, Mantas Mikulėnas > wrote: I'm still not entirely sure of the situation but right now it sounds like the configuration is okay but the Ethernet interface is failing to establish a physica

Re: [systemd-devel] Starting a service before any networking

2023-09-26 Thread Mark Rogers
On Tue, 26 Sept 2023 at 13:44, Mantas Mikulėnas wrote: > I think you're confusing two different states, which have similar > indications – "administrative" up/down that you control (the "" flag, > with nothing shown when down) and "operational" up/down that represents the > actual interface statu

Re: [systemd-devel] Starting a service before any networking

2023-09-26 Thread Mantas Mikulėnas
On Tue, Sep 26, 2023, 15:32 Mark Rogers wrote: > On Tue, 26 Sept 2023 at 13:08, Mantas Mikulėnas wrote: > >> Depends on what exactly runs dhcpcd and wpa_supplicant. Is that done by >> networking.service (ifupdown)? NetworkManager? Are they standalone services? >> > > How do I tell? > Run `syste

Re: [systemd-devel] Starting a service before any networking

2023-09-26 Thread Mark Rogers
On Tue, 26 Sept 2023 at 13:08, Mantas Mikulėnas wrote: > Depends on what exactly runs dhcpcd and wpa_supplicant. Is that done by > networking.service (ifupdown)? NetworkManager? Are they standalone services? > How do I tell? (System is a Pi running an elderly Raspbian. The issue I am having is

Re: [systemd-devel] Starting a service before any networking

2023-09-26 Thread Mantas Mikulėnas
Depends on what exactly runs dhcpcd and wpa_supplicant. Is that done by networking.service (ifupdown)? NetworkManager? Are they standalone services? I would generally expect Before/Wants=network-pre.target to work, but that relies on your network services themselves being set up correctly – they t