From 38f901791f3c4b1cbd04b71323bbef2fdab65f83 Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Sun, 14 May 2023 17:48:25 +0800 Subject: unit-file: support UpheldBy= in [Install] settings (adding Upholds= deps from .upholds/) Closes #26896 --- man/systemctl.xml | 9 ++++----- man/systemd.unit.xml | 39 ++++++++++++++++++++++----------------- 2 files changed, 26 insertions(+), 22 deletions(-) (limited to 'man') diff --git a/man/systemctl.xml b/man/systemctl.xml index 009aabacb9..0e786fd966 100644 --- a/man/systemctl.xml +++ b/man/systemctl.xml @@ -367,10 +367,9 @@ Jan 12 10:46:45 example.com bluetoothd[8900]: gatt-time-server: Input/output err Shows units required and wanted by the specified units. This recursively lists units following the - Requires=, - Requisite=, - ConsistsOf=, - Wants=, BindsTo= + Requires=, Requisite=, + Wants=, ConsistsOf=, + BindsTo=, and Upholds= dependencies. If no units are specified, default.target is implied. @@ -1791,7 +1790,7 @@ Jan 12 10:46:45 example.com bluetoothd[8900]: gatt-time-server: Input/output err Show reverse dependencies between units with list-dependencies, i.e. follow dependencies of type WantedBy=, - RequiredBy=, + RequiredBy=, UpheldBy=, PartOf=, BoundBy=, instead of Wants= and similar. diff --git a/man/systemd.unit.xml b/man/systemd.unit.xml index c618e403f7..e28bfe845e 100644 --- a/man/systemd.unit.xml +++ b/man/systemd.unit.xml @@ -749,8 +749,7 @@ When Upholds=b.service is used on a.service, this dependency will show as UpheldBy=a.service in the property listing of - b.service. The UpheldBy= dependency cannot be specified - directly. + b.service. @@ -1848,6 +1847,12 @@ [Unit] section [Install] section + + Upholds= + UpheldBy= + [Unit] section + [Install] section + PartOf= ConsistsOf= @@ -1895,10 +1900,10 @@ - Note: WantedBy= and RequiredBy= are - used in the [Install] section to create symlinks in .wants/ - and .requires/ directories. They cannot be used directly as a - unit configuration setting. + Note: WantedBy=, RequiredBy=, and UpheldBy= + are used in the [Install] section to create symlinks in .wants/, + .requires/, and .upholds/ directories. They cannot be used + directly as a unit configuration setting. Note: ConsistsOf=, BoundBy=, RequisiteOf=, ConflictedBy= are created @@ -1947,23 +1952,23 @@ WantedBy= RequiredBy= + UpheldBy= This option may be used more than once, or a space-separated list of unit names may - be given. A symbolic link is created in the .wants/ or - .requires/ directory of each of the listed units when this unit is installed by - systemctl enable. This has the effect of a dependency of type - Wants= or Requires= being added from the listed unit to the - current unit. The primary result is that the current unit will be started when the listed unit is - started, see the description of Wants= and Requires= in the - [Unit] section for details. + be given. A symbolic link is created in the .wants/, .requires/, + or .upholds/ directory of each of the listed units when this unit is installed + by systemctl enable. This has the effect of a dependency of type + Wants=, Requires=, or Upholds= being added + from the listed unit to the current unit. See the description of the mentioned dependency types + in the [Unit] section for details. In case of template units listing non template units, the listing unit must have DefaultInstance= set, or systemctl enable must be called with an instance name. The instance (default or specified) will be added to the - .wants/ or .requires/ list of the listed unit. For example, - WantedBy=getty.target in a service getty@.service will result - in systemctl enable getty@tty2.service creating a - getty.target.wants/getty@tty2.service link to + .wants/, .requires/, or .upholds/ + list of the listed unit. For example, WantedBy=getty.target in a service + getty@.service will result in systemctl enable getty@tty2.service + creating a getty.target.wants/getty@tty2.service link to getty@.service. This also applies to listing specific instances of templated units: this specific instance will gain the dependency. A template unit may also list a template unit, in which case a generic dependency will be added where each instance of the listing unit will -- cgit v1.2.1