1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-07 17:17:44 +03:00

man: using WantedBy=default.target is not a good idea

We had several users, that wrote their unit files with
WantedBy=default.target because it should be started "every time".
But for example in Fedora/CentOS/RHEL, this often breaks for
example selinux relabels (where we just want to do a relabel and reboot).

(cherry picked from commit 67b6404b80cf8078f3d9ec6d4c2f34ac25b15077)
(cherry picked from commit adc57cd81c02e5afc8efcbc64eb3a6305a97c62c)
(cherry picked from commit 02447d2888)
This commit is contained in:
Lukas Nykryn 2024-10-01 11:30:18 +02:00 committed by Luca Boccassi
parent 7b9f8e99f3
commit 3f7bf5ac5f

View File

@ -230,6 +230,11 @@
names like <varname>single</varname>, <varname>rescue</varname>, <varname>1</varname>,
<varname>3</varname>, <varname>5</varname>, …; see
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>.</para>
<para>For typical unit files please set <literal>WantedBy=</literal> to a regular target (like
<filename>multi-user.target</filename> or <filename>graphical.target</filename>),
instead of <filename>default.target</filename>, since such a service will also be run on special
boots like on system update, emergency boot…</para>
</listitem>
</varlistentry>
<varlistentry>