Closed Silveere closed 3 months ago
I honestly just took the $MAINPID
method wholesale from the Terarria server implementation in Nixpkgs. I haven't been actively running Minecraft servers in a bit, so I just never noticed that this was an issue. Thanks for the fix!
Running the simple VM test works locally, so I'll go ahead and try to merge this later today after my exam.
This stops the server from being immediately force-killed by systemd. Any process not cleaned up by
ExecStop
is killed by systemd immediately after allExecStop
scripts exit.This also changes the process detection, since
$MAINPID
doesn't seem to exist (at least from the perspective of theExecStop
script). I'm not sure if this is due toProtectProc=invisible
, something with systemd's PID detection, or something else entirely, but the new method seems to work.