[systemd-devel] Best practices for starting unit only if network is online
Paul Menzel
pmenzel+systemd-devel at molgen.mpg.de
Wed Feb 5 12:23:34 UTC 2020
Dear systemd folks,
fwupd ships the service unit `fwupd-refresh.service` with the ordering
below [1].
After=network.target network-online.target systemd-networkd.service
NetworkManager.service connman.service
I would have thought ordering after `network-online.target` would be
enough. Are there best practices for ensuring that the network is working?
(As a sidenote, the service seems to be only activated by a timer [2],
so network will be up probably.)
Kind regards,
Paul
[1]:
https://github.com/fwupd/fwupd/blob/4f28afb6e720215a33805f37d1845ec425a45256/data/motd/fwupd-refresh.service.in#L4
[2]:
https://github.com/fwupd/fwupd/blob/master/data/motd/fwupd-refresh.timer
More information about the systemd-devel
mailing list