Skip to content

Commit d1f4da9

Browse files
keszybzdmach
authored andcommitted
dnf-makecache.timer: move the ordering after network to .service
The timer does not need the network. The service needs it. Move the After=network-online.target line to the service file. Wants=network-online.target is still in .timer, which means that the network-online.target and services that implement it will be pulled in from the .timer and started eagerly. But there is no ordering, so they only need to finish before the .service is started. Keeping the ordering dependency between timer and network-online.target means that network-online.target is ordered before multi-user.target, which is wrong, because it delays multi-user.target for no good reason. This patch changes the ordering so that the service will be started {10 minutes after boot} or when the network is available, whatever is later, and not 10 minutes after {the network is available and the boot is finished, whatever is later}. Tested by running an affected system without AdamWill's patch but with this patch, and confirming that the ordering loop is gone. (AdamWill's patch is correct on its own, because putting this timer and the associated service in basic.target is bonkers.) Follow-up for 3144280. Signed-off-by: Zbigniew Jędrzejewski-Szmek <[email protected]>
1 parent b7279cc commit d1f4da9

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

etc/systemd/dnf-makecache.service

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ Description=dnf makecache
55
# anyone who wants that could override this via a file in /etc.
66
ConditionPathExists=!/run/ostree-booted
77

8+
After=network-online.target
9+
810
[Service]
911
Type=oneshot
1012
Nice=19

etc/systemd/dnf-makecache.timer

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ ConditionKernelCommandLine=!rd.live.image
44
# See comment in dnf-makecache.service
55
ConditionPathExists=!/run/ostree-booted
66
Wants=network-online.target
7-
After=network-online.target
87

98
[Timer]
109
OnBootSec=10min

0 commit comments

Comments
 (0)