services: restart Minecraft after it exits on its own
All checks were successful
nixos / nixos (push) Successful in 28s
All checks were successful
nixos / nixos (push) Successful in 28s
AutoUpdateGeyser restarts the server with /restart. Paper finds no start script, stops and exits 0, and Restart=always should start it again. The module binds the stdin socket to the service, though: the exit stopped the socket, the socket's stop cancelled the restart, and the server stayed down from 2026-11-17 16:01 until started by hand. PartOf keeps the socket across an exit and still stops it with the service. FlushPending already drops the "stop" ExecStop leaves in the FIFO. Assisted-by: Claude:opus-5-5
This commit is contained in:
parent
8a6db9c5b4
commit
55f3036574
1 changed files with 10 additions and 0 deletions
|
|
@ -28,6 +28,16 @@
|
||||||
pkgs.stdenv.cc.cc.lib
|
pkgs.stdenv.cc.cc.lib
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
# AutoUpdateGeyser restarts the server with /restart; Paper finds no
|
||||||
|
# start script and exits 0, and systemd must start it again. The
|
||||||
|
# module binds the stdin socket to the service, so the exit stopped
|
||||||
|
# the socket and the socket's stop cancelled Restart=always. PartOf
|
||||||
|
# keeps the socket across an exit and still stops it with the service.
|
||||||
|
systemd.services.minecraft-server.serviceConfig.RestartSec = 10;
|
||||||
|
systemd.sockets.minecraft-server = {
|
||||||
|
bindsTo = lib.mkForce [ ];
|
||||||
|
partOf = [ "minecraft-server.service" ];
|
||||||
|
};
|
||||||
networking.firewall.allowedTCPPorts = [ 25565 ];
|
networking.firewall.allowedTCPPorts = [ 25565 ];
|
||||||
asxpio.security.ports = [
|
asxpio.security.ports = [
|
||||||
"tcp/25565/java"
|
"tcp/25565/java"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue