From 739e4d75a8ca7e13ebec5658567491ce1edb74e3 Mon Sep 17 00:00:00 2001 From: Stepan Blyshchak <38952541+stepanblyschak@users.noreply.github.com> Date: Mon, 19 Dec 2022 07:32:18 +0200 Subject: [PATCH] [timer.unit.j2] use wanted-by in timer unit (#2546) Signed-off-by: Stepan Blyschak Signed-off-by: Stepan Blyschak --- sonic-utilities-data/templates/timer.unit.j2 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sonic-utilities-data/templates/timer.unit.j2 b/sonic-utilities-data/templates/timer.unit.j2 index 250bf446a8..09989f2c51 100644 --- a/sonic-utilities-data/templates/timer.unit.j2 +++ b/sonic-utilities-data/templates/timer.unit.j2 @@ -13,3 +13,7 @@ Unit={{ manifest.service.name }}{% if multi_instance %}@%i{% endif %}.service [Install] WantedBy=timers.target sonic.target sonic-delayed.target +{%- for service in manifest.service["wanted-by"] %} +WantedBy={{ service }}{% if multi_instance and service in multi_instance_services %}@%i{% endif %}.service +{%- endfor %} +