Home

WantedBymultiusertarget

WantedBy is a directive used in the install section of a systemd unit file. It declares which targets should cause the unit to be started when the target is activated, by creating a symbolic link in the target's wants directory.

For example, [Install] WantedBy=multi-user.target means that enabling the unit will cause systemd to create a link

This relationship is a "Wants" dependency, which is weaker than a "Requires" dependency. It expresses a preference

Management is performed with systemctl enable and systemctl disable. Enabling creates the link; disabling removes it.

Notes: The install section and WantedBy entries affect boot-time activation, not runtime behavior by themselves. They

such
as
/etc/systemd/system/multi-user.target.wants/myservice.service.
When
the
system
reaches
the
multi-user
target
during
boot,
the
service
will
be
started
automatically
if
enabled.
rather
than
a
hard
guarantee.
The
target
can
be
active
without
the
unit
being
present,
but
enabling
the
unit
ensures
it
is
started
with
the
target
whenever
possible.
You
can
verify
state
with
systemctl
is-enabled
<unit>.
The
mechanism
is
commonly
used
to
arrange
boot
order
for
services
that
should
run
in
non-graphical
or
multi-user
environments,
as
opposed
to
Graphical.target
where
GUI
services
run.
can
be
combined
with
other
dependencies
and
conditions
defined
in
the
unit's
[Unit]
section
to
control
start
conditions.