Skip to content

Add systemd service+timer#12

Merged
okurz merged 2 commits into
os-autoinst:masterfrom
okurz:feature/systemd_timer
Sep 17, 2025
Merged

Add systemd service+timer#12
okurz merged 2 commits into
os-autoinst:masterfrom
okurz:feature/systemd_timer

Conversation

@okurz

@okurz okurz commented Sep 15, 2025

Copy link
Copy Markdown
Member

Comment thread systemd/openqa_bugfetcher.timer

@aylen384 aylen384 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we have two instances of this service with two config files (one for o3 and one for osd) it would make sense to create an openqa_bugfetcher@.service supplying the name of the config file via %i.

Also note that for o3 we are only running every 10 hours while for osd we run every 10 minutes.
That is because for osd we actually only process bugrefs that were not updated within a certain timeframe,
while for o3 we only can query public bugs (not to leak internal data) so private bugs will not get updated and therefore retried with every call of bugfetcher. The 10 hour interval is there to reduce unneccesary load on bugzilla.
A switch from cron to systemd timers needs to take this into account.

# minute (0-59),
# |      hour (0-23),
# |      |       day of the month (1-31),
# |      |       |       month of the year (1-12),
# |      |       |       |       day of the week (0-6 with 0=Sunday).
# |      |       |       |       |       user  commands

*/10     *       *       *       *       …  (date;fetch_openqa_bugs)> /tmp/fetch_openqa_bugs_osd.log
1        */10    *       *       *       …  (date;fetch_openqa_bugs /etc/openqa/bugfetcher_o3.conf) > /tmp/fetch_openqa_bugs_o3.log

Comment thread systemd/openqa_bugfetcher.service Outdated
@okurz

okurz commented Sep 15, 2025

Copy link
Copy Markdown
Member Author

As we have two instances of this service with two config files (one for o3 and one for osd) it would make sense to create an openqa_bugfetcher@.service supplying the name of the config file via %i.

Also note that for o3 we are only running every 10 hours while for osd we run every 10 minutes. That is because for osd we actually only process bugrefs that were not updated within a certain timeframe, while for o3 we only can query public bugs (not to leak internal data) so private bugs will not get updated and therefore retried with every call of bugfetcher. The 10 hour interval is there to reduce unneccesary load on bugzilla. A switch from cron to systemd timers needs to take this into account.

# minute (0-59),
# |      hour (0-23),
# |      |       day of the month (1-31),
# |      |       |       month of the year (1-12),
# |      |       |       |       day of the week (0-6 with 0=Sunday).
# |      |       |       |       |       user  commands

*/10     *       *       *       *       …  (date;fetch_openqa_bugs)> /tmp/fetch_openqa_bugs_osd.log
1        */10    *       *       *       …  (date;fetch_openqa_bugs /etc/openqa/bugfetcher_o3.conf) > /tmp/fetch_openqa_bugs_o3.log

Changed to openqa_bugfetcher@.service. But that means that the default of openqa_bugfetcher.conf will not be usable for this service. Anyway for our specific instance I would then instantiate two services "osd" and "o3", rename the /etc/openqa/bugfetcher.conf to /etc/openqa/bugfetcher_osd.conf and of course use the custom time specifications for both.

@aylen384 aylen384 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good

@aylen384

Copy link
Copy Markdown
Member

Changed to openqa_bugfetcher@.service.

Did you forget to push? Because there is no template service in the diff.

@okurz
okurz force-pushed the feature/systemd_timer branch from 9b92794 to bf51626 Compare September 17, 2025 08:23
@okurz

okurz commented Sep 17, 2025

Copy link
Copy Markdown
Member Author

Changed to openqa_bugfetcher@.service.

Did you forget to push? Because there is no template service in the diff.

good you realized. I actually had the issue of outdated plain-git protocol in .git/config

@okurz
okurz force-pushed the feature/systemd_timer branch from bf51626 to e56d8a0 Compare September 17, 2025 08:44
@okurz
okurz merged commit 6f14020 into os-autoinst:master Sep 17, 2025
5 checks passed
@okurz
okurz deleted the feature/systemd_timer branch September 17, 2025 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants