SameOS ~/tools/game-server-systemd-startup.md

Game Server Fails After Reboot: Read and Fix systemd Startup Errors

Published and official references checked 2026-09-07 · SameOS operator

A server may run from SSH yet disappear after reboot. Your login shell and a systemd service do not share the same execution environment. Before copying the startup command again, establish whether the failure is boot registration, process setup or game initialization.

1. Running now and enabled at boot are separate

Active describes current state; enabled describes startup registration through a target. A manually started service may not start after reboot. Before enabling a disabled service, verify that it points to the intended live world.

minecraft.service is a placeholder. A static unit may be started by another dependency; a masked unit is blocked. Investigate why it was masked before undoing it.

systemctl is-active minecraft.service
systemctl is-enabled minecraft.service
systemctl status minecraft.service --no-pager -l

2. Read the first failure from this boot

The final status line may show only restart limiting and hide the original error. Read this boot with journalctl -b and locate the first failure. Previous-boot logs with -b -1 are available only if retained.

203/EXEC points to execution setup, 200/CHDIR to the working directory and 217/USER to user credential setup. They do not themselves mean a damaged world. A mod error emitted after launch belongs to game initialization instead.

journalctl -u minecraft.service -b -n 150 --no-pager
systemctl show minecraft.service -p Result -p ExecMainStatus -p NRestarts

3. Check executable and working directory

Confirm unit paths still exist after updates. The Java executable used by the service may differ from the one in your shell. For a Palworld launch script, check executable permission, the interpreter on its first line and Linux line endings.

An incorrect WorkingDirectory can redirect relative config, mod and world paths. A new empty world may indicate the wrong working directory. Check it before copying saves over anything. Redact credentials from configuration output before sharing.

systemctl cat minecraft.service
systemctl show minecraft.service -p User -p Group -p WorkingDirectory -p ExecStart
ls -ld /srv/minecraft /srv/minecraft/data
ls -l /srv/minecraft/server.jar
/usr/bin/java -version

4. Do not assume an interactive shell environment

Services generally do not read your .bashrc to prepare aliases or PATH. A version-manager Java installation or relative script may therefore fail at boot. Use verified paths and explicitly provide only required environment values.

ExecStart is not a general shell command line. Pipes, redirection and && do not automatically behave as they do in a shell. Use a reviewed wrapper when needed, checking signal and exit propagation to the game.

Do not hide permissions problems by running as root. Check the service user can read and write the required data and traverse its parent directories. Making all of /srv world-writable exposes unrelated services.

5. Wait for the actual data mount

For a world on another disk, inspect mount failure and startup ordering together. An existing directory is insufficient: findmnt should report the intended filesystem. Repair mount failures first.

RequiresMountsFor=/srv/minecraft/data expresses required mount dependencies for a path. The disk must still be correctly configured in mount units or fstab. Adding the option to a mistyped empty directory cannot guarantee the intended disk is present.

Startup work needing networking also needs failure handling. Combining automatic updates with every boot lets internet or distribution-server problems prevent the game from starting. Separately inspect update and normal launch behavior to make failures easier to diagnose.

findmnt -T /srv/minecraft/data
systemctl --failed --no-pager

6. Reload configuration and start after fixing the cause

After editing a unit, daemon-reload rereads it. reset-failed clears failure state and start-limit counters; it does not repair a bad executable path. If the service already runs, start below does not restart it. Apply running-service changes in a separate maintenance window after saving.

Restart=on-failure and an appropriate delay can handle transient failures, but retries do not repair paths or permissions. Preserve the first error and fix it before relying on automatic restart.

sudo systemctl daemon-reload
sudo systemctl reset-failed minecraft.service
sudo systemctl start minecraft.service
systemctl status minecraft.service --no-pager -l

7. Verify a planned reboot and a real join

Enable boot startup only after manual start, save and graceful stop work. Announce maintenance, then verify mounts, process state, world loading and external joining after a planned reboot. The examples do not immediately reboot a production host.

A server that opened a new world or another save path has not recovered correctly. Inspect familiar builds and player state, then confirm a small saved change persists. Keep this boot log and final unit configuration as the baseline for the next update.

Verification scope and official references

This Linux operations guide was checked against the linked documentation and command options. Paths, service names, addresses and diagnostic scenarios are illustrative, not incident reports or performance measurements from SameOS game servers. We did not induce production failures or modify production saves. Confirm paths and behavior for your game build and deployment before applying changes.

Read the SameOS writing, translation, and review policy

Minecraft systemd installation Palworld installation Check external joining after startup