1

I am configuring dnf-automatic to automatically install security updates on some low priority test boxes. Eventually I want to the updates to run every Sunday morning around 4-5AM, but for testing purposes I've configured the boxes to kick off the update Wed afternoons at 14:xx and minimised any randomisation for now. After being started, the first update does run at it's schedule time, but if I then look at the timer status in systemd, the next schedule time of running is 6am the next day. I understand this is the time that dnf-automatic executes by default which may bear some relation, but I don't see where this is referenced in my config:

● dnf-automatic-install.timer - dnf-automatic-install timer
   Loaded: loaded (/usr/lib/systemd/system/dnf-automatic-install.timer; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/dnf-automatic-install.timer.d
           └─override.conf
   Active: active (waiting) since Wed 2023-12-06 14:45:31 GMT; 20min ago
  **Trigger: Thu 2023-12-07 06:00:02 GMT; 14h left**

Dec 06 14:45:31 dcbutlpocglog5.zonalconnect.local systemd[1]: Started dnf-automatic-install timer.

Relevant config files as follows:

[root@dcbutlpocglog5 ~]# cat /etc/systemd/system/dnf-automatic-install.timer.d/override.conf
[Unit]
Description=dnf-automatic-install timer
# See comment in dnf-makecache.service
ConditionPathExists=!/run/ostree-booted
Wants=network-online.target

[Timer] OnCalendar=Wed 14:51 RandomizedDelaySec=5s Persistent=true

[Install] WantedBy=timers.target

[root@dcbutlpocglog5 ~]# cat /etc/dnf/automatic.conf [commands] upgrade_type = security

[emitters] emit_via = motd

[install] upgrade_requirements_on_install = yes download_updates = yes apply_updates = yes gpgcheck = 1 emit_via = motd random_sleep = 5 reboot = yes

Can anybody tell me why this is happening please, and help me prevent the extra updates running outside of what is configured?

Thanks

1 Answers1

2

Fix found, it seems SystemD timers are additive and an additional blank "OnCalendar=" parameter was needed in front of my own to clear the normal one:

[Timer]
OnCalendar=
OnCalendar=Wed 14:51
RandomizedDelaySec=5s
Persistent=true

Result:

[root@dcbutlpocglog5 ~]# systemctl status dnf-automatic-install.timer
● dnf-automatic-install.timer - dnf-automatic-install timer
Loaded: loaded (/usr/lib/systemd/system/dnf-automatic-install.timer; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/dnf-automatic-install.timer.d
└─override.conf
Active: active (waiting) since Wed 2023-12-06 14:45:31 GMT; 20h ago
**Trigger: Wed 2023-12-13 14:51:03 GMT; 6 days left**