Skip to content

Commit

Permalink
[202205] [timer.unit.j2] use wanted-by in timer unit (#2561)
Browse files Browse the repository at this point in the history
- What I did
I fixed the timer unit template to account "wanted-by" option in the manifest. In case service is delayed, "wanted-by" is applied to the timer unit that delays it.

- How I did it
I updated timer.unit.j2 template

- How to verify it
Make sure that "WantedBy" is rendered in the timer unit.

Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
  • Loading branch information
stepanblyschak authored Dec 26, 2022
1 parent f45dcfb commit f7988b0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sonic-utilities-data/templates/timer.unit.j2
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ Unit={{ manifest.service.name }}{% if multi_instance %}@%i{% endif %}.service

[Install]
WantedBy=timers.target sonic.target
{%- for service in manifest.service["wanted-by"] %}
WantedBy={{ service }}{% if multi_instance and service in multi_instance_services %}@%i{% endif %}.service
{%- endfor %}

0 comments on commit f7988b0

Please sign in to comment.