Triggering a short-living service with a path unit making use of PathExists restarts the service multiple times in a row then fails
Issue
-
On RHEL7 and RHEL8, having a short-living service triggered by
PathExistsproperty was not getting respawned until start limit occurred, whereas with RHEL9 and later it does and failsRHEL9 # 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.