Commit e012273
fix: handle SIGHUP in launcher-patcher to prevent exits before updating (#1641)
### Motivation
The launcher-patcher tries to update the launcher.jar after the node &
launcher exit. This process did not work when `screen` or `tmux` was
used to start the launcher due to the fact that they send a `SIGHUG`
signal and the JVM handles the signal and stops the still running
(waiting) launcher-patcher. This required users to download the launcher
themselves when we did changes to the launcher.
### Modification
Introduced a handler for `SIGHUP` in the launcher-patcher that ignores
the signal. Furthermore, this introduces a 5 second timeout when waiting
for the launcher to exit before running the patcher as the launcher
should not take that long to stop and to prevent replacing the next
running launcher instance getting replaced while running.
### Result
Launcher updates are properly working when using `screen` or `tmux`
---------
Co-authored-by: Pasqual Koschmieder <git@derklaro.dev>1 parent 5b74133 commit e012273
1 file changed
Lines changed: 34 additions & 13 deletions
File tree
- launcher/patcher/src/main/java/eu/cloudnetservice/launcher/patcher
Lines changed: 34 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| 25 | + | |
24 | 26 | | |
| 27 | + | |
| 28 | + | |
25 | 29 | | |
26 | 30 | | |
27 | 31 | | |
28 | 32 | | |
29 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
30 | 43 | | |
31 | 44 | | |
32 | | - | |
| 45 | + | |
33 | 46 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
38 | 52 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
45 | 63 | | |
46 | 64 | | |
47 | 65 | | |
48 | 66 | | |
49 | 67 | | |
50 | | - | |
51 | 68 | | |
52 | 69 | | |
53 | 70 | | |
54 | 71 | | |
55 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
56 | 77 | | |
0 commit comments