]> git.ipfire.org Git - thirdparty/systemd.git/commit
core: also check boot ID and product UUID in ConditionHost=
authorLennart Poettering <lennart@poettering.net>
Wed, 19 Feb 2025 16:15:41 +0000 (17:15 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 20 Feb 2025 17:13:38 +0000 (18:13 +0100)
commit25ec3fdfd309abbaf28b9d0ff19a99cbca016d61
treed093d9e27097ed5bef428cbe3c33a5124f941ed5
parent9ef8138946362f42111d1a53dfc91c796546ca50
core: also check boot ID and product UUID in ConditionHost=

Sometimes it's interesting to condition units not just on the
installation but on the physical device. Let's make ConditionHost=
useful for that kind of checks, and while we are at it, also allow it to
be used for condition checks on the boot id.

Overloading like this is safe, since UUIDs are globally unique after
all, and hence there should be no conflicts between the namespace of
boot ids, machine ids and product ids.

Finally, relax rules on uuid checking: if the specified string parses
as uuid or id, also check it against the hostname, for setups where
people name hosts after uuids. I wouldn't know why anyone would do that,
but also, why not? shouldn'rt hurt allowing them and should not create
ambiguity conflicts.
man/systemd.unit.xml
src/shared/condition.c