Commit Graph
82509 Commits
Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 773cb7aa7e docs/TRANSIENT-SETTINGS: update lists
Those lists were partially wrong and partially outdated. We should generate
this document automatically, but let's revisit this topic after the conversion
to sphinx. For now, as a stop-gap solution, I generated the lists from
the new 'systemd-analyze transient-settings' command.
2025-07-03 21:03:26 +02:00
Zbigniew Jędrzejewski-Szmek a839c4b7b7 analyze: add transient-settings verb
Related to https://github.com/systemd/systemd/pull/37641.

The name "transient settings" was used in docs/TRANSIENT-SETTINGS.md.
Using "setting" helps distinguish this from D-Bus "properties", which are
a much larger set, partially overlapping.
2025-07-03 21:03:26 +02:00
Zbigniew Jędrzejewski-Szmek 1c1626e063 shared/bus-unit-util: add bus_dump_transient_settings() helper
bus_append_unit_property() and associated functions accept a long list of
properties. But the specific names are only available through code. But it is
useful to be able to know the specific list of properties that is supported, in
particular for shell completions. Thus, add a way to list the properties that
are supported by the code.

In the future we could also turn this into a test for the documentation. For
various reasons, the list of properties listed in the docs is a partially
overlapping set. E.g. for service type, the pull request
https://github.com/systemd/systemd/pull/37661 creates a list with 212 entries,
and this code generates 7 entries less and 184 more. I didn't check all the
differences, but in the few cases I did, the list generated here was actually
correctly supported by 'systemd-run -p'.

A smoke test is added.
2025-07-03 21:03:26 +02:00
Zbigniew Jędrzejewski-Szmek c133545430 shared/bus-unit-util: convert to a table 2025-07-03 19:58:15 +02:00
Zbigniew Jędrzejewski-Szmek b77e4fc6ce shared/bus-unit-util: add helper for TimeoutSec= 2025-07-03 19:58:15 +02:00
Zbigniew Jędrzejewski-Szmek 73ac906bec shared/bus-unit-util: add define to shorten common append pattern 2025-07-03 19:58:12 +02:00
Zbigniew Jędrzejewski-Szmek 472a1faae8 shared/bus-unit-util: add helper for AppArmorProfile=/SmackProcessLabel= 2025-07-03 19:53:40 +02:00
Zbigniew Jędrzejewski-Szmek dbd4d4cc43 shared/bus-unit-util: add helper for CPUQuotaPeriodSec=ManagedOOMMemoryPressureDurationSec= 2025-07-03 19:53:40 +02:00
Zbigniew Jędrzejewski-Szmek 5e18038da2 shared/bus-unit-util: add helper for unit deps 2025-07-03 19:53:40 +02:00
Zbigniew Jędrzejewski-Szmek a90d205af5 shared/bus-unit-util: define helper for conditions and asserts
The function has "try" in the name because it dynamically checks
if the field name matches.
2025-07-03 19:53:40 +02:00
Zbigniew Jędrzejewski-Szmek 9806468ea4 shared/bus-unit-util: define helper for SuccessActionExitStatus= and friend 2025-07-03 19:53:40 +02:00
Zbigniew Jędrzejewski-Szmek bfa7d82661 shared/bus-unit-util: add helper for TimersCalendar property 2025-07-03 19:53:40 +02:00
Zbigniew Jędrzejewski-Szmek c3c21b2bc4 shared/bus-unit-util: add helper for TimersMonotonic property 2025-07-03 19:53:40 +02:00
Zbigniew Jędrzejewski-Szmek d661a540a3 shared/bus-unit-util: add helper for Listen property 2025-07-03 19:53:38 +02:00
Zbigniew Jędrzejewski-Szmek 65ebd48e6f shared/bus-unit-util: use common helper for various strv properties 2025-07-03 19:35:33 +02:00
Zbigniew Jędrzejewski-Szmek 7673abfc2b shared/bus-unit-util: define helper for SuccessExitStatus= and friends 2025-07-03 19:35:33 +02:00
Zbigniew Jędrzejewski-Szmek 7a5eb9d03d shared/bus-unit-util: define helper for Paths property 2025-07-03 19:35:33 +02:00
Zbigniew Jędrzejewski-Szmek 9228d67dc8 test: drop ProtectHostnameEx, add one test for ProtectHostnameEx
This is a separate commit because the parent commit is supposed to be
backward compatible, i.e. the tests must pass with both the bogus ProtectHostnameEx
name and ProtectHostname.

A test is added for ProtectHostnameEx to verify that it is still accepted
for backward compat.
2025-07-03 19:35:33 +02:00
Zbigniew Jędrzejewski-Szmek 9e3bc6406b shared/bus-unit-util: add helper for ProtectHostnameEx and fix naming confusion
As with grandparent commit for ImportCredentialEx=, the whole series of commits
that extended ProtectHostname was confused (6746f28854,
cf48bde7ae, e76fcd0e40),
because it added ProtectHostnameEx in places where parsing of ProtectHostname
should be have been extended.

Accept ProtectHostname=… with the new extended syntax, keep accepting
ProtectHostnameEx=… for compat with release v257. Prefer sending ProtectHostname.

Partially resolves https://github.com/systemd/systemd/issues/37174.
2025-07-03 19:35:33 +02:00
Zbigniew Jędrzejewski-Szmek 779aed7443 shared/bus-unit-util: add a helper function for directory args 2025-07-03 19:35:33 +02:00
Zbigniew Jędrzejewski-Szmek e04484ad7c shared/bus-unit-util: define helper for ExtensionImages= 2025-07-03 19:35:33 +02:00
Zbigniew Jędrzejewski-Szmek 1c202720be shared/bus-unit-util: define helper for MountImages= 2025-07-03 19:35:33 +02:00
Zbigniew Jędrzejewski-Szmek 79decd4e49 shared/bus-unit-util: define helper for RootImageOptions= 2025-07-03 19:35:33 +02:00
Zbigniew Jędrzejewski-Szmek 5517273715 shared/bus-unit-util: define helper for RootHashSignature= 2025-07-03 19:35:33 +02:00
Zbigniew Jędrzejewski-Szmek 4d92c1da45 shared/bus-unit-util: define helper for RootHash= 2025-07-03 19:35:33 +02:00
Zbigniew Jędrzejewski-Szmek 8f90f4b86f shared/bus-unit-util: define helper for TemporaryFileSystem= 2025-07-03 19:35:33 +02:00
Zbigniew Jędrzejewski-Szmek 0fdcbaf633 shared/bus-unit-util: define helper for BindPaths=/BindReadOnlyPaths= 2025-07-03 19:35:33 +02:00
Zbigniew Jędrzejewski-Szmek af677b7a25 shared/bus-unit-util: define helper for RestrictNamespaces=/DelegateNamespaces= 2025-07-03 19:35:33 +02:00
Zbigniew Jędrzejewski-Szmek c622449cb7 shared/bus-unit-util: add helper for filter lists 2025-07-03 19:35:33 +02:00
Zbigniew Jędrzejewski-Szmek 187b248e5b shared/bus-unit-util: add helper for NUMAMask= 2025-07-03 19:35:33 +02:00
Zbigniew Jędrzejewski-Szmek 85eb4381d3 shared/bus-unit-util: use common helper for NUMAPolicy= 2025-07-03 19:35:33 +02:00
Zbigniew Jędrzejewski-Szmek 6dd31c8339 shared/bus-unit-util: define helper for CPUAffinity= 2025-07-03 19:35:12 +02:00
Zbigniew Jędrzejewski-Szmek 8f0824f9db shared/bus-unit-util: define helper for CapabilityBoundingSet=/AmbientCapabilities= 2025-07-03 10:37:34 +02:00
Zbigniew Jędrzejewski-Szmek 94abee6063 shared/bus-unit-util: define helper function for rlimits
Strictly speaking, we call startswith twice now. This duplication
shall be eliminated later.
2025-07-03 10:37:34 +02:00
Zbigniew Jędrzejewski-Szmek 5c41755fe6 shared/bus-unit-util: define helper for StandardInputData= 2025-07-03 10:37:34 +02:00
Zbigniew Jędrzejewski-Szmek 6bb4420100 shared/bus-unit-util: define helper for StandardInputText= 2025-07-03 10:37:34 +02:00
Zbigniew Jędrzejewski-Szmek 375351d003 shared/bus-unit-util: define helper functions for StandardInput/Output/Error= 2025-07-03 10:37:34 +02:00
Zbigniew Jędrzejewski-Szmek 32adb97cf1 shared/bus-unit-util: define helper for LogFilterPatterns= 2025-07-03 10:37:34 +02:00
Zbigniew Jędrzejewski-Szmek 50dd808d69 shared/bus-unit-util: define helper for LogExtraFields= 2025-07-03 10:37:34 +02:00
Zbigniew Jędrzejewski-Szmek 0b5b043733 TEST-54-CREDS: s/ImportCredentialEx/ImportCredential/ except for one place
This is a separate commit because the tests are supposed to pass with both
the old spelling and the new.
2025-07-03 10:37:34 +02:00
Zbigniew Jędrzejewski-Szmek 4b98aeb6ef shared/bus-unit-util: add helper for ImportCredentialEx= and fix naming confusion
We add D-Bus properties like "*Ex" because we cannot change the D-Bus property
type without breaking backward comapatibility. But those names are only for
D-Bus, not for config file stanzas or the command-line parser. There, we can
change the type, or in other words, there is no type, just a free-form string
whose interpretation we can extend or change. Commit
831f208783 that added ProtectHostnameEx was
confused, because it added ImportCredentialEx in places where parsing of
ImportCredential should be have been extended.

On D-Bus, we send ImportCrednential in preference, and ImportCredentialEx only
when required. This way we send less bytes on the wire and support older
systems that don't understand the new property.

Partially resolves https://github.com/systemd/systemd/issues/37174.
2025-07-03 10:37:34 +02:00
Zbigniew Jędrzejewski-Szmek 068c4c8677 shared/bus-unit-util: define helper for LoadCredential=/LoadCredentialEncrypted= 2025-07-03 10:37:34 +02:00
Zbigniew Jędrzejewski-Szmek 82e009a212 shared/bus-unit-util: define helper for SetCredential=/SetCredentialEncrypted= 2025-07-03 10:37:34 +02:00
Zbigniew Jędrzejewski-Szmek 7c4b4a93d6 shared/bus-unit-util: define helper function for EnvironmentFile= 2025-07-03 10:37:34 +02:00
Zbigniew Jędrzejewski-Szmek 4eb516e319 shared/bus-unit-util: add helper for SocketBindAllow=/SocketBindDeny= 2025-07-03 10:37:34 +02:00
Zbigniew Jędrzejewski-Szmek 513026c4bf shared/bus-unit-util: define helper for BPFProgram= 2025-07-03 10:37:34 +02:00
Zbigniew Jędrzejewski-Szmek 9f17f68bc5 shared/bus-unit-util: add helper for IPIngressFilterPath=/IPEgressFilterPath= 2025-07-03 10:37:33 +02:00
Zbigniew Jędrzejewski-Szmek af33eb4bb7 shared/bus-unit-util: define helper function for IPAddressAllow=/IPAddressDeny= 2025-07-03 10:37:33 +02:00
Zbigniew Jędrzejewski-Szmek 235c580d80 shared/bus-unit-util: define helper for IODeviceLatencyTargetSec= 2025-07-03 10:37:33 +02:00
Zbigniew Jędrzejewski-Szmek 335f7c7f01 shared/bus-unit-util: define helper for IODeviceWeight= 2025-07-03 10:37:33 +02:00