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 2132374 - Timer fails due to Service unit not meeting conditions
Summary: Timer fails due to Service unit not meeting conditions
Keywords:
Status: CLOSED DUPLICATE of bug 2114005
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: systemd
Version: 8.6
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: systemd-maint
QA Contact: Frantisek Sumsal
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-10-05 12:54 UTC by Renaud Métrich
Modified: 2022-10-06 12:47 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-10-05 14:01:03 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-135722 0 None None None 2022-10-05 13:06:49 UTC

Description Renaud Métrich 2022-10-05 12:54:08 UTC
Description of problem:

Assuming we want to use timers in replacement to cron, I would expect that a timer that elapses but doesn't start the service unit because some condition is not met wouldn't enter "failed" state:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
# systemctl status my-timer.timer
● my-timer.timer
   Loaded: loaded (/etc/systemd/system/my-timer.timer; static; vendor preset: disabled)
   Active: failed (Result: unit-condition-failed) since Wed 2022-10-05 14:44:00 CEST; 1min 5s ago
  Trigger: n/a

Oct 05 14:42:53 vm-rhel8 systemd[1]: Started my-timer.timer.
Oct 05 14:44:00 vm-rhel8 systemd[1]: my-timer.timer: Failed with result 'unit-condition-failed'.

# systemctl status my-timer.service
● my-timer.service
   Loaded: loaded (/etc/systemd/system/my-timer.service; static; vendor preset: disabled)
   Active: inactive (dead)
Condition: start condition failed at Wed 2022-10-05 14:43:01 CEST; 2min 20s ago
           └─ ConditionPathExists=/var/run/my-timer was not met
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

Such behavior prevents running a service regularly.

Version-Release number of selected component (if applicable):

systemd-239-58.el8_6.7.x86_64

How reproducible:

Always

Steps to Reproduce:
1. Create a dummy timer and service triggered on a non-met condition

-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
# systemctl cat my-timer.timer my-timer.service
# /etc/systemd/system/my-timer.timer
[Timer]
OnCalendar=minutely
RandomizedDelaySec=0

# /etc/systemd/system/my-timer.service
[Unit]
ConditionPathExists=/var/run/my-timer

[Service]
Type=oneshot
ExecStart=/bin/echo "HELLO FROM my-timer.service"
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

2. Start the timer and wait for it to elapse

-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
# systemctl start my-timer.timer
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

Actual results:

Timer enters "failed" state and doesn't elapse anymore every minute:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
# systemctl status my-timer.timer
● my-timer.timer
   Loaded: loaded (/etc/systemd/system/my-timer.timer; static; vendor preset: disabled)
   Active: failed (Result: unit-condition-failed) since Wed 2022-10-05 14:44:00 CEST; 1min 5s ago
  Trigger: n/a

Oct 05 14:42:53 vm-rhel8 systemd[1]: Started my-timer.timer.
Oct 05 14:44:00 vm-rhel8 systemd[1]: my-timer.timer: Failed with result 'unit-condition-failed'.
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

Expected results:

Timer doesn't fail and nothing special happens.

Comment 1 David Tardon 2022-10-05 14:01:03 UTC
This is caused by https://github.com/redhat-plumbers/systemd-rhel8/commit/2820f1706275acd787c72d9a57892200566f0bbe , which has been reverted as a part of fix of bug 2114005.

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


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