I am trying to have a minecraft server auto start on a screen after the server reboot. Currently using CentOS 7. Here's my minecraft.service i put in systemd.

Description=Start Minecraft



And here's my bash that ExecStart calls

screen -d -m -S minecraft java -Xmx1536M -Xms1536M -jar minecraft_server.1.13.2_carpet.jar nogui
echo hi

the echo is just to test if it's working, and i do get a hi if i do #systemctl status minecraft.service

However, no screen is setup on startup. When i manually run the bash, it does run the minecraft server correctly in a different screen.

If i remove the screen part of the bash and just do exec java -Xmx1536M -Xms1536M -jar minecraft_server.1.13.2_carpet.jar nogui in my bash file, it also works, just doesn't give me a screen so i have no access to the minecraft server console.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.