Skip to content

Commit

Permalink
Create unit files to auto restart services after minion update
Browse files Browse the repository at this point in the history
  • Loading branch information
baierjan committed Apr 11, 2024
1 parent 42c8473 commit a75be56
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,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
eval "$$(perl -V:installvendorlib)" && sed -i -e "s^installvendorlib^$$installvendorlib^" systemd/openqa-minion-restart.path
for i in systemd/*.{service,slice,target,timer,path}; do \
install -m 644 $$i "$(DESTDIR)"/usr/lib/systemd/system ;\
done
Expand Down
2 changes: 2 additions & 0 deletions dist/rpm/openQA.spec
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,8 @@ fi
%{_localstatedir}/lib/openqa/script
%{_localstatedir}/lib/openqa/tests
%{_datadir}/openqa/script/openqa-check-devel-repo
%{_unitdir}/openqa-minion-restart.service
%{_unitdir}/openqa-minion-restart.path

%files worker
%{_datadir}/openqa/lib/OpenQA/CacheService/
Expand Down
5 changes: 5 additions & 0 deletions systemd/openqa-minion-restart.path
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[Path]
PathChanged=installvendorlib/Minion/Backend/resources/migrations/pg.sql

[Install]
WantedBy=multi-user.target
6 changes: 6 additions & 0 deletions systemd/openqa-minion-restart.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[Unit]
Description=Restarts services which are using Minion

[Service]
Type=oneshot
ExecStart=/usr/bin/systemctl try-restart openqa-webui.service openqa-gru.service openqa-worker-cacheservice.service openqa-worker-cacheservice-minion.service

0 comments on commit a75be56

Please sign in to comment.