Commit 6021dbf
committed
Add signal handler and shutdown hook
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 resulting in the container eventually 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 2800800 commit 6021dbf
1 file changed
+15
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
| |||
95 | 97 | | |
96 | 98 | | |
97 | 99 | | |
| 100 | + | |
98 | 101 | | |
99 | 102 | | |
100 | 103 | | |
101 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
102 | 117 | | |
103 | 118 | | |
104 | 119 | | |
| |||
0 commit comments