]> git.ipfire.org Git - thirdparty/systemd.git/commit
unit: don't bother determining unit install state for transient or perpetual units
authorLennart Poettering <lennart@poettering.net>
Mon, 24 Feb 2025 22:35:57 +0000 (23:35 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 1 Apr 2025 14:44:20 +0000 (16:44 +0200)
commite735bc49ac2a64a9b044731cfa36ed0950884ea3
tree72705e5fe5a221d3eb31017ef79df7b615810a04
parentc5855d9640e7fd91fdd8b2e3ebd2741fec0caef5
unit: don't bother determining unit install state for transient or perpetual units

I noticed that we keep querying the preset database for transient units,
which makes little sense, since transient units are well, transient, and
hence not suject to enablement/disablement. Hence, let's shortcut things
and simply not check the preset database for them.

While we are at it, shortcut unit file state checks for transient units,
too.  We know they are transient already, we can return that directly,
no need to go to disk.

Finally, treat perpetual units like transient units for the the preset
case: also bypass the preset database. (But keep checking for the unit
file state for them, since it *is* relevant to know whether they were
generated or not.)
src/core/unit.c