Skip to content

Commit

Permalink
WIP: Add service files to restart worker after config changes without…
Browse files Browse the repository at this point in the history
… interrupting running jobs

* Not tested at all; just to see how such a change would look like
* See https://progress.opensuse.org/issues/80910

---

* We could actually also watch for a packaged file so it would also apply
  to package updates.
* Then we could also get rid of `OPENQA_WORKER_TERMINATE_AFTER_JOBS_DONE=1`
  in the auto-restart service file.
  • Loading branch information
Martchus committed Jan 11, 2021
1 parent f0d1c57 commit 641d2e5
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -78,7 +78,7 @@ install-generic:
install -d -m 755 "$(DESTDIR)"/usr/lib/systemd/system
install -d -m 755 "$(DESTDIR)"/usr/lib/systemd/system-generators
install -d -m 755 "$(DESTDIR)"/usr/lib/tmpfiles.d
for i in systemd/*.{service,target,timer}; do \
for i in systemd/*.{service,target,timer,path}; do \
install -m 644 $$i "$(DESTDIR)"/usr/lib/systemd/system ;\
done
sed \
Expand Down
2 changes: 2 additions & 0 deletions dist/rpm/openQA.spec
Expand Up @@ -566,6 +566,8 @@ fi
%{_unitdir}/openqa-worker-cacheservice.service
%{_unitdir}/openqa-worker-no-cleanup@.service
%{_unitdir}/openqa-worker-auto-restart@.service
%{_unitdir}/openqa-soft-restart-worker@.service
%{_unitdir}/openqa-soft-restart-worker@.path
%{_unitdir}/openqa-slirpvde.service
%{_unitdir}/openqa-vde_switch.service
%{_datadir}/openqa/script/openqa-slirpvde
Expand Down
4 changes: 4 additions & 0 deletions systemd/openqa-soft-restart-worker@.path
@@ -0,0 +1,4 @@
# see https://www.freedesktop.org/software/systemd/man/systemd.path.html#PathExists=

[Path]
PathChanged=/etc/openqa/workers.ini
8 changes: 8 additions & 0 deletions systemd/openqa-soft-restart-worker@.service
@@ -0,0 +1,8 @@
[Unit]
Description=Restarts openQA Worker #%i as soon as possible without interrupting jobs

[Service]
Type=oneshot
User=_openqa-worker
ExecStart=systemctl kill --signal SIGHUP openqa-worker-auto-restart@%i.service
Slice=openqa-worker.slice

0 comments on commit 641d2e5

Please sign in to comment.