[systemd-devel] Ensuring that a unit starts before any networking

Reindl Harald h.reindl at thelounge.net
Tue Jun 30 13:04:58 UTC 2020



Am 30.06.20 um 14:55 schrieb Simon McVittie:
> Adding After=network-pre.target to dhcpcd.service is probably also not
> a bad idea. It isn't clear to me whether dhcpcd brings up interfaces of
> its own accord just because you start it as a systemd unit

it just fails when like in the example below the interface "br-guest"
isn't already there, and hence it's not that simple to say when a dhcp
service should be started

i just made it all easier by throw away all the NetworkManager,
systemd-networkd or whatever stuff and wrote a oneshot-unit with a ton
of ExecStart configuring all my interfaces, bridges and hostapd-instances

[root at srv-rhsoft:~]$ cat /etc/systemd/system/dhcpd-guest.service
[Unit]
Description=DHCPD Guest-WLAN
After=network-up.service
Requires=network-online.target network-up.service

[Service]
Type=notify
ExecStart=/usr/sbin/dhcpd -4 -f -cf /etc/dhcp/dhcpd-guest.conf -lf
/var/lib/dhcpd/dhcpd-guest.leases -user dhcpd -group dhcpd --no-pid br-guest
Restart=always


More information about the systemd-devel mailing list