diff options
author | Daan De Meyer <daan.j.demeyer@gmail.com> | 2021-09-01 11:21:28 +0200 |
---|---|---|
committer | Daan De Meyer <daan.j.demeyer@gmail.com> | 2021-10-28 12:42:21 +0200 |
commit | 88022148c4769f7d39a9ef3cc41cef3f3479eaad (patch) | |
tree | bf75b3380bb7710d61f0f17476b757b937ecb037 /man/systemd.unit.xml | |
parent | basic: Make ret_names param to unit_file_find_fragment() optional (diff) | |
download | systemd-88022148c4769f7d39a9ef3cc41cef3f3479eaad.tar.xz systemd-88022148c4769f7d39a9ef3cc41cef3f3479eaad.zip |
core: Try to prevent infinite recursive template instantiation
To prevent situations like in #17602 from happening, let's drop
direct recursive template dependencies. These will almost certainly
lead to infinite recursion so let's drop them immediately to avoid
instantiating potentially thousands of irrelevant units.
Example of a template that would lead to infinite recursion which
is caught by this check:
notify@.service:
```
[Unit]
Wants=notify@%n.service
```
Diffstat (limited to 'man/systemd.unit.xml')
-rw-r--r-- | man/systemd.unit.xml | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/man/systemd.unit.xml b/man/systemd.unit.xml index b6e4a2233c..dbf56c26a5 100644 --- a/man/systemd.unit.xml +++ b/man/systemd.unit.xml @@ -2256,8 +2256,12 @@ OnFailure=failure-handler@%N.service services will have acquired an <varname>OnFailure=</varname> dependency on <filename index='false'>failure-handler@%N.service</filename>. The template instance units will also have gained the dependency which results - in the creation of a recursive dependency chain. We can break the chain by - disabling the drop-in for the template instance units via a symlink to + in the creation of a recursive dependency chain. systemd will try to detect + these recursive dependency chains where a template unit directly and + recursively depends on itself and will remove such dependencies + automatically if it finds them. If systemd doesn't detect the recursive + dependency chain, we can break the chain ourselves by disabling the drop-in + for the template instance units via a symlink to <filename index='false'>/dev/null</filename>:</para> <programlisting> |