From 3eb1395706ca0a00ac15d59098a0250b0377e6b5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sat, 13 Jul 2013 23:36:39 -0400 Subject: [PATCH] man: tweak WantedBy=/RequiredBy= description a bit https://bugs.freedesktop.org/show_bug.cgi?id=55663 --- man/systemd.unit.xml | 45 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 9 deletions(-) diff --git a/man/systemd.unit.xml b/man/systemd.unit.xml index a870f6b17..a14e452fa 100644 --- a/man/systemd.unit.xml +++ b/man/systemd.unit.xml @@ -1115,19 +1115,46 @@ WantedBy= RequiredBy= - Installs a symlink in - the .wants/ - or .requires/ - subdirectory for a unit, respectively. This has the - effect that when the listed unit name - is activated the unit listing it is - activated - too. WantedBy=foo.service + A symbolic link is + created in the + .wants/ or + .requires/ folder + of the listed unit when this unit is + activated by systemctl + enable. This has the effect + that a dependency of type + Wants= or + Requires= is 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. + + WantedBy=foo.service in a service bar.service is mostly equivalent to Alias=foo.service.wants/bar.service - in the same file. + in the same file. In case of template + units, systemctl enable + must be called with an instance name, and + this instance will be added to the + .wants/ or + .requires/ list + of the listed unit. + E.g. 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. + -- 2.30.2