Files
Fabian Pflug 1c4c37d21a systemd-systemctl: enable templated services
The wrapper script previously did not allow to instantiate templated
services without DefaultInstance defined. This change allows
foo@.service be installed and therefor be in enabled state.

In real systemd land, templated units without a specified instance are
valid, but we restrict it here a bit in order to not have a foo@.service
with:

  [Install]
  WantedBy=bar.service    # bar.service starts -> start foo@???.service

In this case, system can never resolve the specific instance of
foo@.service when bar.service is started. It is fixed by adding the
template_only variable, which restricts the dependents of generic
template units to template-only ones. This means the following is still
legal for the above foo@.service:

  [Install]
  WantedBy=bar@.service   # bar@1.service starts -> start foo@1.service
                          # bar@2.service starts -> start foo@2.service
                          # etc...

  WantedBy=bas@1.service  # bas@1.service starts -> start foo@1.service
                          # bas@2.service starts -> no dependency here
                          # etc...

Signed-off-by: Fabian Pflug <f.pflug@pengutronix.de>
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
2026-09-08 08:23:16 -07:00
..