]> git.ipfire.org Git - thirdparty/systemd.git/commit
fix: do not check/verify slice units if recursive errors are to be ignored
authorMaanya Goenka <maanyagoenka@microsoft.com>
Wed, 27 Sep 2023 15:44:04 +0000 (15:44 +0000)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 28 Sep 2023 22:32:02 +0000 (23:32 +0100)
commitf660c7fa56b247c278fdb2ebcfea37912f249524
tree476127fd8eaa4f3b7de30dcf33af3b3fecb16123
parent76dc9e249fb823ecf0cc8a82f559f33c941463bb
fix: do not check/verify slice units if recursive errors are to be ignored

Before this fix, when recursive-errors was set to 'no' during a systemd-analyze
verification, the parent slice was checked regardless. The 'no' setting means that,
only the specified unit should be looked at and verified and errors in the slices should be
ignored. This commit fixes that issue.

Example:

Say we have a sample.service file:

[Unit]
Description=Sample Service

[Service]
ExecStart=/bin/echo "a"
Slice=support.slice

Before Change:

systemd-analyze verify --recursive-errors=no maanya/sample.service
Assertion 'u' failed at src/core/unit.c:153, function unit_has_name(). Aborting.
Aborted (core dumped)

After Change:
systemd-analyze verify --recursive-errors=no maanya/sample.service
{No errors}
src/core/slice.c
test/units/testsuite-65.sh