Skip to content

Commit 0bb175a

Browse files
DOMjudge teammeisterT
DOMjudge team
authored andcommitted
Make reboot handler gracefully shut down judgedaemon
1 parent d5522ff commit 0bb175a

File tree

1 file changed

+20
-1
lines changed
  • provision-contest/ansible/roles/judgedaemon/handlers

1 file changed

+20
-1
lines changed

Diff for: provision-contest/ansible/roles/judgedaemon/handlers/main.yml

+20-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,25 @@
2323
- name: Update grub
2424
command: update-grub
2525

26-
- name: Reboot
26+
- name: Get judgedaemon PID
27+
pids:
28+
name: judgedaemon
29+
register: judgedaemon_pids
30+
listen: Reboot
31+
32+
- name: Signal judgedaemon to shut down
33+
command: kill -SIGHUP "{{ item }}"
34+
with_items: "{{ judgedaemon_pids.pids }}"
35+
listen: Reboot
36+
37+
- name: Wait for judgedaemon to finish
38+
wait_for:
39+
path: "/proc/{{ item }}/status
40+
state: absent
41+
with_items: "{{ judgedaemon_pids.pids }}"
42+
listen: Reboot
43+
44+
- name: Reboot finally
2745
reboot:
2846
search_paths: ['/lib/molly-guard', '/sbin']
47+
listen: Reboot

0 commit comments

Comments
 (0)