Bug 2193262
| Summary: | timer units gets skipped when running systemctl daemon-reload as its trigger time gets recalculated | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 9 | Reporter: | Juan Gamba <jgamba> |
| Component: | systemd | Assignee: | systemd-maint |
| Status: | CLOSED DUPLICATE | QA Contact: | Frantisek Sumsal <fsumsal> |
| Severity: | urgent | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 9.1 | CC: | dtardon, systemd-maint-list |
| Target Milestone: | rc | Flags: | pm-rhel:
mirror+
|
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2023-05-15 11:51:59 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
*** This bug has been marked as a duplicate of bug 1719364 *** Bug 1719364 was opened for RHEL 8, This bug is the same bug but it was open for RHEL 9 as it is still present. JGamba *** This bug has been marked as a duplicate of bug 2211065 *** |
Description of problem: timer units gets skipped when running systemctl daemon-reload as its trigger time gets recalculated when the reload is executed past its OnCalendar= and before the RandomeDelaySec= values. Version-Release number of selected component (if applicable): systemd-250-12.el9_1.x86_64 How reproducible: Always Steps to Reproduce: 1. create the units, enable and start it [root@r91 ~]# cat /etc/systemd/system/test.timer [Unit] Description=Starts randomized test timer [Timer] RandomizedDelaySec=10800 OnCalendar=Thu 22:45 [Install] WantedBy=timers.target [root@r91 ~]# cat /etc/systemd/system/test.service [Unit] Description=static unit for test timer [Service] Type=oneshot ExecStart=/usr/bin/echo "executed" [root@r91 ~]# systemctl daemon-reload [root@r91 ~]# systemctl enable --now test.timer Created symlink /etc/systemd/system/timers.target.wants/test.timer → /etc/systemd/system/test.timer. [root@r91 ~]# systemctl status -l test.timer test.service ● test.timer - Starts randomized test timer Loaded: loaded (/etc/systemd/system/test.timer; enabled; vendor preset: disabled) Active: active (waiting) since Thu 2023-05-04 22:44:31 UTC; 6s ago Until: Thu 2023-05-04 22:44:31 UTC; 6s ago Trigger: Fri 2023-05-05 00:45:17 UTC; 2h 0min left Triggers: ● test.service May 04 22:44:31 r91 systemd[1]: Started Starts randomized test timer. ○ test.service - static unit for test timer Loaded: loaded (/etc/systemd/system/test.service; static) Active: inactive (dead) TriggeredBy: ● test.timer 2. wait the OnCalendar= time and reload systemd but not after the actual trigger date [root@r91 ~]# systemctl daemon-reload Actual results: The trigger date is recalculated skipping the job until next OnCalendar= [root@r91 ~]# date Thu May 4 10:44:54 PM UTC 2023 [root@r91 ~]# date Thu May 4 10:45:19 PM UTC 2023 [root@r91 ~]# date Thu May 4 10:45:42 PM UTC 2023 [root@r91 ~]# date Thu May 4 10:46:28 PM UTC 2023 [root@r91 ~]# systemctl status -l test.timer test.service ● test.timer - Starts randomized test timer Loaded: loaded (/etc/systemd/system/test.timer; enabled; vendor preset: disabled) Active: active (waiting) since Thu 2023-05-04 22:44:31 UTC; 2min 3s ago Until: Thu 2023-05-04 22:44:31 UTC; 2min 3s ago Trigger: Fri 2023-05-05 00:45:17 UTC; 1h 58min left Triggers: ● test.service May 04 22:44:31 r91 systemd[1]: Started Starts randomized test timer. ○ test.service - static unit for test timer Loaded: loaded (/etc/systemd/system/test.service; static) Active: inactive (dead) TriggeredBy: ● test.timer [root@r91 ~]# systemctl daemon-reload [root@r91 ~]# systemctl status -l test.timer test.service ● test.timer - Starts randomized test timer Loaded: loaded (/etc/systemd/system/test.timer; enabled; vendor preset: disabled) Active: active (waiting) since Thu 2023-05-04 22:44:31 UTC; 2min 12s ago Until: Thu 2023-05-04 22:44:31 UTC; 2min 12s ago Trigger: Thu 2023-05-11 23:16:31 UTC; 1 week 0 days left Triggers: ● test.service May 04 22:44:31 r91 systemd[1]: Started Starts randomized test timer. ○ test.service - static unit for test timer Loaded: loaded (/etc/systemd/system/test.service; static) Active: inactive (dead) TriggeredBy: ● test.timer Expected results: To keep the same trigger date to avoid skipping the job as the timer unit was not changed. [root@r91 ~]# systemctl daemon-reload [root@r91 ~]# systemctl status -l test.timer test.service ● test.timer - Starts randomized test timer Loaded: loaded (/etc/systemd/system/test.timer; enabled; vendor preset: disabled) Active: active (waiting) since Thu 2023-05-04 22:44:31 UTC; 2min 12s ago Until: Thu 2023-05-04 22:44:31 UTC; 2min 12s ago Trigger: Fri 2023-05-05 00:45:17 UTC; 1h 58min left Triggers: ● test.service Additional info: This bug is also present in RHEL 7 and RHEL 8, it was first detected by Renaud in RHEL 8.2 and it is still present in RHEL 8.7. And I did not find it reported for rHEL 9. JGamba