Triggering a short-living service with a path unit making use of PathExists restarts the service multiple times in a row then fails

Solution Verified - Updated -

Issue

  • On RHEL7 and RHEL8, having a short-living service triggered by PathExists property was not getting respawned until start limit occurred, whereas with RHEL9 and later it does and fails

    RHEL9 # cat /etc/systemd/system/test-pathexists.path
    [Path]
    PathExists=/tmp/pathexists.test
    
    RHEL9 # cat /etc/systemd/system/test-pathexists.service
    [Service]
    ExecStart=/bin/echo "I'm getting triggered"
    
    RHEL9 # systemctl start test-pathexists.path 
    RHEL9 # touch /tmp/pathexists.test
    RHEL9 # journal -u test-pathexists.service
    [...] 13:03:24 vm-rhel9 systemd[1]: Started test-pathexists.service.
    [...] 13:03:24 vm-rhel9 echo[1408]: I'm getting triggered
    [...] 13:03:24 vm-rhel9 systemd[1]: test-pathexists.service: Deactivated successfully.
    [...] 13:03:24 vm-rhel9 systemd[1]: Started test-pathexists.service.
    [...] 13:03:24 vm-rhel9 echo[1409]: I'm getting triggered
    [...] 13:03:24 vm-rhel9 systemd[1]: test-pathexists.service: Deactivated successfully.
    [...] 13:03:24 vm-rhel9 systemd[1]: Started test-pathexists.service.
    [...] 13:03:24 vm-rhel9 echo[1410]: I'm getting triggered
    [...] 13:03:24 vm-rhel9 systemd[1]: test-pathexists.service: Deactivated successfully.
    [...] 13:03:24 vm-rhel9 systemd[1]: Started test-pathexists.service.
    [...] 13:03:24 vm-rhel9 echo[1411]: I'm getting triggered
    [...] 13:03:24 vm-rhel9 systemd[1]: test-pathexists.service: Deactivated successfully.
    [...] 13:03:24 vm-rhel9 systemd[1]: Started test-pathexists.service.
    [...] 13:03:24 vm-rhel9 echo[1412]: I'm getting triggered
    [...] 13:03:24 vm-rhel9 systemd[1]: test-pathexists.service: Deactivated successfully.
    [...] 13:03:24 vm-rhel9 systemd[1]: test-pathexists.service: Start request repeated too quickly.
    [...] 13:03:24 vm-rhel9 systemd[1]: test-pathexists.service: Failed with result 'start-limit-hit'.
    [...] 13:03:24 vm-rhel9 systemd[1]: Failed to start test-pathexists.service.
    

Environment

  • Red Hat Enterprise Linux 9 and later (RHEL9)

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