Skip to content

Commit

Permalink
Make reboot handler gracefully shut down judgedaemon
Browse files Browse the repository at this point in the history
  • Loading branch information
DOMjudge team authored and meisterT committed May 5, 2024
1 parent d5522ff commit 0bb175a
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion provision-contest/ansible/roles/judgedaemon/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,25 @@
- name: Update grub
command: update-grub

- name: Reboot
- name: Get judgedaemon PID
pids:
name: judgedaemon
register: judgedaemon_pids
listen: Reboot

- name: Signal judgedaemon to shut down
command: kill -SIGHUP "{{ item }}"
with_items: "{{ judgedaemon_pids.pids }}"
listen: Reboot

- name: Wait for judgedaemon to finish
wait_for:
path: "/proc/{{ item }}/status
state: absent
with_items: "{{ judgedaemon_pids.pids }}"
listen: Reboot

- name: Reboot finally
reboot:
search_paths: ['/lib/molly-guard', '/sbin']
listen: Reboot

0 comments on commit 0bb175a

Please sign in to comment.