core: support CollectMode in Varlink StartTransient

The io.systemd.Unit context exposes CollectMode, but StartTransient
rejects it as unsupported. This prevents Varlink clients from selecting
whether failed transient units should be garbage-collected.

Accept CollectMode when creating transient units and persist the setting
in the runtime unit configuration. Extend the integration test to verify
the value in both the Varlink response and the resulting unit.
This commit is contained in:
Tim Culverhouse
2026-07-25 15:35:28 +09:00
committed by Yu Watanabe
parent e09402326c
commit 4517e7e4d9
3 changed files with 19 additions and 7 deletions
+1 -1
View File
@@ -1570,7 +1570,7 @@ static SD_VARLINK_DEFINE_STRUCT_TYPE(
SD_VARLINK_DEFINE_FIELD(parameter, SD_VARLINK_STRING, SD_VARLINK_NULLABLE));
/* UnitContext is used both as input to StartTransient (subset settable at creation time: ID,
* Description, Service, and the Exec subset {WorkingDirectory, Environment, SetCredential,
* Description, CollectMode, Service, and the Exec subset {WorkingDirectory, Environment, SetCredential,
* SetCredentialEncrypted}) and as output from List/StartTransient (full unit configuration). Fields
* that are not settable at creation time are rejected with PropertyNotSupported when supplied as
* input. */