[systemd-devel] Starting a service before any networking
Jetchko Jekov
jetchko.jekov at gmail.com
Wed Sep 27 13:08:38 UTC 2023
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.target
Ubuntu's ufw.service (bit more elaborate, no idea why):
DefaultDependencies=no
Before=network-pre.target
Wants=network-pre.target local-fs.target
After=local-fs.target
More information about the systemd-devel
mailing list