RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2193262 - timer units gets skipped when running systemctl daemon-reload as its trigger time gets recalculated
Summary: timer units gets skipped when running systemctl daemon-reload as its trigger ...
Keywords:
Status: CLOSED DUPLICATE of bug 2211065
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: systemd
Version: 9.1
Hardware: Unspecified
OS: Linux
unspecified
urgent
Target Milestone: rc
: ---
Assignee: systemd-maint
QA Contact: Frantisek Sumsal
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-05-04 22:54 UTC by Juan Gamba
Modified: 2023-05-31 08:59 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-05-15 11:51:59 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-156463 0 None None None 2023-05-04 22:58:01 UTC

Description Juan Gamba 2023-05-04 22:54:50 UTC
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

Comment 1 David Tardon 2023-05-15 11:51:59 UTC

*** This bug has been marked as a duplicate of bug 1719364 ***

Comment 2 Juan Gamba 2023-05-29 12:56:03 UTC
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

Comment 3 David Tardon 2023-05-31 08:59:17 UTC

*** This bug has been marked as a duplicate of bug 2211065 ***


Note You need to log in before you can comment on or make changes to this bug.