Re: Starting a service before any networking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 too need to order themselves After that target.

On Tue, Sep 26, 2023, 13:51 Mark Rogers <mark@xxxxxxxxxxxxxxxxxxxx> 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_supplicant.conf but this might grow in future.

As such the only dependency the script has is that the filesystem is up and running. But the script must complete before anything that the script manages the configuration file for.

My current unit looks like this:
[Unit]
Before=networking.service
After=local-fs.target

[Service]
Type=oneshot
ExectStart=/path/to/script

[Install]
RequiredBy=network.target

Where am I going wrong and what is the right way to do this?

I've also tried Before=network-pre.target and Wants=network-pre.target without success - it was that not working that set me off trying to fix it.
--
Mark Rogers


[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux