5384e84c46
In many CI runs I noticed a race where we check the "active" state a bit too early where the unit is still in the "inactive" state, causing the `is-failed` check to fail. Mitigate this by waiting even if the unit is in the inactive state and introduce a "safe net" which checks whether the unit is not restarting indefinitely or more than it should (as described in the original issue #3166). Example: ``` [ 5.757784] testsuite-11.sh[216]: + systemctl --no-block start fail-on-restart.service [ 5.853657] testsuite-11.sh[222]: ++ systemctl show --value --property ActiveState fail-on-restart.service [ 5.946044] testsuite-11.sh[216]: + active_state=inactive [ 5.946044] testsuite-11.sh[216]: + [[ inactive == \a\c\t\i\v\a\t\i\n\g ]] [ 5.946044] testsuite-11.sh[216]: + [[ inactive == \a\c\t\i\v\e ]] [ 5.946044] testsuite-11.sh[216]: + systemctl is-failed fail-on-restart.service [ 5.946816] systemd[1]: fail-on-restart.service: Passing 0 fds to service [ 5.946913] systemd[1]: fail-on-restart.service: About to execute false [ 5.947011] systemd[1]: fail-on-restart.service: Forked false as 228 [ 5.947093] systemd[1]: fail-on-restart.service: Changed dead -> start [ 5.947172] systemd[1]: Starting Fail on restart... [ 5.947272] systemd[228]: fail-on-restart.service: Executing: false [ 5.960553] testsuite-11.sh[227]: activating [ 5.965188] testsuite-11.sh[216]: + exit 1 [ 6.011838] systemd[1]: Received SIGCHLD from PID 228 (4). [ 6.012510] systemd[1]: fail-on-restart.service: Main process exited, code=exited, status=1/FAILURE [ 6.012638] systemd[1]: fail-on-restart.service: Failed with result 'exit-code'. [ 6.012834] systemd[1]: fail-on-restart.service: Service will restart (restart setting) [ 6.012963] systemd[1]: fail-on-restart.service: Changed running -> failed [ 6.013081] systemd[1]: fail-on-restart.service: Unit entered failed state. ``` |
||
---|---|---|
.github | ||
.lgtm/cpp-queries | ||
.mkosi | ||
.semaphore | ||
catalog | ||
coccinelle | ||
docs | ||
factory/etc | ||
hwdb.d | ||
man | ||
mkosi.default.d | ||
modprobe.d | ||
network | ||
po | ||
presets | ||
rules.d | ||
shell-completion | ||
src | ||
sysctl.d | ||
sysusers.d | ||
test | ||
tmpfiles.d | ||
tools | ||
units | ||
xorg | ||
.clang-format | ||
.ctags | ||
.dir-locals.el | ||
.editorconfig | ||
.gitattributes | ||
.gitignore | ||
.lgtm.yml | ||
.mailmap | ||
.packit.yml | ||
.vimrc | ||
.ycm_extra_conf.py | ||
configure | ||
LICENSE.GPL2 | ||
LICENSE.LGPL2.1 | ||
Makefile | ||
meson_options.txt | ||
meson.build | ||
mkosi.build | ||
NEWS | ||
README | ||
README.md | ||
TODO |
System and Service Manager
Details
Most documentation is available on systemd's web site.
Assorted, older, general information about systemd can be found in the systemd Wiki.
Information about build requirements is provided in the README file.
Consult our NEWS file for information about what's new in the most recent systemd versions.
Please see the Code Map for information about this repository's layout and content.
Please see the Hacking guide for information on 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.
Stable branches with backported patches are available in the stable repo.