mirror of
https://github.com/systemd/systemd.git
synced 2025-03-24 14:50:17 +03:00
When a unit job finishes early (e.g. when fork(2) fails) triggered unit goes through states stopped->failed (or failed->failed), in case a ExecStart= command fails unit passes through stopped->starting->failed. The former transition doesn't result in unit active/inactive timestamp being updated and timer (OnUnitActiveSec= or OnUnitInactiveSec=) would use an expired timestamp triggering immediately again (repeatedly). This patch exploits timer's last trigger timestamp to ensure the timer isn't triggered more frequently than OnUnitActiveSec=/OnUnitInactiveSec= period. Steps to reproduce: 0) Create sample units: cat >~/.config/systemd/user/looper.service <<EOD [Service] ExecStart=/usr/bin/sleep 2 EOD cat >~/.config/systemd/user/looper.timer <<EOD [Timer] AccuracySec=5 OnUnitActiveSec=5 EOD 1) systemctl --user daemon-reload 2) systemctl --user start looper.timer # to have first activation timestamp/sentinel systemctl --user start looper.service o Observe the service is being regularly triggered. 3) systemctl set-property user@$UID.service TasksMax=2 o Observe the tight looping as long as the looper.service cannot be started. Ref: #5969
systemd - System and Service Manager
Details
General information about systemd can be found in the systemd Wiki.
Information about build requirements are provided in the README file.
Consult our NEWS file for information about what's new in the most recent systemd versions.
Please see the HACKING file for information how to hack on systemd and test your modifications.
Please see our Contribution Guidelines for more information about filing GitHub Issues and posting GitHub Pull Requests.
When preparing patches for systemd, please follow our Coding Style Guidelines.
If you are looking for support, please contact our mailing list or join our IRC channel.
Languages
C
89.2%
Python
5.3%
Shell
4.1%
Meson
1.2%