Skip to content

Commit

Permalink
Merge pull request #12683 from yuumasato/ensure_logrotate_activated_o…
Browse files Browse the repository at this point in the history
…n_timers.target.wants

ensure_logrotate_activated: Check timers.target.wants as well
  • Loading branch information
rhmdnd authored Dec 9, 2024
2 parents 3081d84 + a29b458 commit 18a737b
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<criteria comment="Check if either logrotate timer or cron job is enabled" operator="OR">
<criterion comment="Check if /etc/cron.daily/logrotate file exists (and calls logrotate)" test_ref="test_cron_daily_logrotate_existence" />
{{% if product in ["rhcos4", "rhel9", "rhel10", "sle12", "sle15", "ol9"] %}}
<criterion comment="Check if logrotate timer is enabled" test_ref="test_logrotate_enabled_multi_user_target" />
<criterion comment="Check if logrotate timer is enabled" test_ref="test_logrotate_enabled_systemd_target" />
{{% endif %}}
</criteria>
</criteria>
Expand Down Expand Up @@ -56,14 +56,14 @@

{{% if product in ["rhcos4", "rhel9", "rhel10", "sle12", "sle15", "ol9"] %}}
<unix:file_test check="all" check_existence="all_exist"
comment="look for logrotate.timer in /etc/systemd/system/multi-user.target.wants"
id="test_logrotate_enabled_multi_user_target" version="1">
<unix:object object_ref="object_logrotate_enabled_multi_user_target" />
comment="look for logrotate.timer in multi-user.target.wants and timers.target.wants"
id="test_logrotate_enabled_systemd_target" version="1">
<unix:object object_ref="object_logrotate_enabled_systemd_target" />
</unix:file_test>

<unix:file_object comment="look for logrotate.timer in /etc/systemd/system/multi-user.target.wants"
id="object_logrotate_enabled_multi_user_target" version="1">
<unix:filepath>/etc/systemd/system/multi-user.target.wants/logrotate.timer</unix:filepath>
<unix:file_object comment="look for logrotate.timer in /etc/systemd/system/multi-user.target.wants and /etc/systemd/system/timers.target.wants"
id="object_logrotate_enabled_systemd_target" version="1">
<unix:filepath operation="pattern match">^/etc/systemd/system/(multi-user|timers)\.target\.wants/logrotate\.timer$</unix:filepath>
<filter action="include">unit_logrotate_state_symlink</filter>
</unix:file_object>

Expand Down

0 comments on commit 18a737b

Please sign in to comment.