Commit 3ee86fd
authored
Add signal handler and shutdown hook (#54)
When the application is running in a container, it is given PID 1 which
means it does not automatically get given signal handlers and can't be
killed. When running the container in the foreground this stops Ctrl-C
from interrupting it while in kubernetes it means the graceful shutdown
always times out and the container ends up being forcibly deleted,
killing the process.
Adding an explicit handler for the common signals used to interrupt
processes means that Ctrl-C, kubernetes and `podman stop` all work as
expected.1 parent 8b334be commit 3ee86fd
1 file changed
+17
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| |||
65 | 67 | | |
66 | 68 | | |
67 | 69 | | |
68 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
69 | 85 | | |
0 commit comments