geforkt von SteamWar/PersistentBungeeCore
Merge pull request 'Use SIGUSR1 to softstop' (#28) from sigusr1 into master
Reviewed-on: SteamWar/PersistentBungeeCore#28 Reviewed-by: YoyoNow <jwsteam@nidido.de>
Dieser Commit ist enthalten in:
Commit
355218c761
@ -136,10 +136,15 @@ public class Subserver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void stop() {
|
public void stop() {
|
||||||
if(checkpoint)
|
try {
|
||||||
process.children().forEach(ProcessHandle::destroy);
|
long pid = process.pid();
|
||||||
else
|
if(checkpoint)
|
||||||
execute("stop");
|
pid = process.children().findAny().map(ProcessHandle::pid).orElse(pid);
|
||||||
|
|
||||||
|
Runtime.getRuntime().exec(new String[]{"kill", "-SIGUSR1", Long.toString(pid)});
|
||||||
|
} catch (IOException e) {
|
||||||
|
ProxyServer.getInstance().getLogger().log(Level.SEVERE, "Failed to send SIGUSR1 to subserver.", e);
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if(!process.waitFor(1, TimeUnit.MINUTES))
|
if(!process.waitFor(1, TimeUnit.MINUTES))
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren