Sim, citando a seção relevante da página man do system.unit :
WantedBy=, RequiredBy=
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 that a dependency of typeWants=
orRequires=
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 ofWants=
andRequires=
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 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[email protected]
will result in systemctl enable [email protected] creating agetty.target.wants/[email protected]
link to[email protected]
.
Embora se você quiser executar isso para vários destinos, certifique-se de ajustar a ordem, se necessário (por exemplo, para desligamento ou suspensão) através das diretivas Before=
ou After=
(que também são explicadas na página man;)). / p>