systemd timer unit behaves differently in between RHEL7 and RHEL8.

Solution Unverified - Updated -

Issue

  • systemd timer unit behaves differently in between RHEL7 and RHEL8 even if we use same unit file.
  • In this example, the timer unit is configured to run shell script via service unit files every minute. The shell script sleeps 90 seconds and does logger commands.

  • In RHEL7(systemd-208-20.el7), it looks like the script starts every minute 00 seconds and sleeps for 90 seconds, so it appears that the next execution is skipped.
    In the below example, executions of Jul 5 02:28:00 and Jul 5 02:30:00 seem to be skipped.

    Jul  5 02:27:00 rhel7u1 systemd: Starting timertest...
    Jul  5 02:27:00 rhel7u1 logger[19354]: timertest start
    Jul  5 02:28:30 rhel7u1 logger[19356]: timertest end
    Jul  5 02:28:30 rhel7u1 systemd: Started timertest.
    Jul  5 02:29:00 rhel7u1 systemd: Starting timertest...
    Jul  5 02:29:00 rhel7u1 logger[19362]: timertest start
    Jul  5 02:30:30 rhel7u1 logger[19363]: timertest end
    Jul  5 02:30:30 rhel7u1 systemd: Started timertest.
    Jul  5 02:31:00 rhel7u1 systemd: Starting timertest...
    Jul  5 02:31:00 rhel7u1 logger[19369]: timertest start
    Jul  5 02:32:30 rhel7u1 logger[19370]: timertest end
    
  • But in RHEL8(systemd-239-29.el8), it looks like the next execution started immediately after the finish of the previous execution.
    In the below example, the execution finished at Jul 5 03:14:40 and then the next execution started at Jul 5 03:14:41.

    Jul  5 03:13:10 rhel8u1 systemd[1]: Starting timertest...
    Jul  5 03:13:10 rhel8u1 root[5218]: timertest start
    Jul  5 03:14:40 rhel8u1 root[5257]: timertest end          <<<===
    Jul  5 03:14:41 rhel8u1 systemd[1]: Started timertest.     <<<===
    Jul  5 03:14:41 rhel8u1 systemd[1]: Starting timertest...  <<<===
    Jul  5 03:14:41 rhel8u1 root[5264]: timertest start        <<<===
    Jul  5 03:16:11 rhel8u1 root[5302]: timertest end
    Jul  5 03:16:11 rhel8u1 systemd[1]: Started timertest.
    Jul  5 03:16:11 rhel8u1 systemd[1]: Starting timertest...
    Jul  5 03:16:11 rhel8u1 root[5309]: timertest start
    
  • Is this behaviour expected?

Environment

  • RHEL7
    • systemd-208-20.el7
  • RHEL8
    • systemd-239-29.el8

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content