I've followed many tutorials, but for some reason the service for my minecraft server won't read the server.properties file. I have a basic understanding of Ubuntu (had to learn how to use it for personal projects and college).
However, when I start it normally through the command line with the following command java -Xms4G -Xmx12G -jar serverstarter-2.0.1.jar nogui
it does read the server properties file. I already checked if any other server.properties files exist on the system, and as far as I am aware there is only one on the system.
Is this a problem related to screen, or is there anything else I'm doing wrong?
My [email protected] file looks like this:
[Unit]
Description=Minecraft Server: %i
After=network.target
[Service]
WorkingDirectory=/opt/minecraft-servers/%i
User=minecraft
Group=minecraft
ProtectSystem=full
ProtectHome=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectControlGroups=true
Restart=always
ExecStart=/usr/bin/screen -DmS mc-%i /usr/bin/java -Xms4G -Xmx12G -jar serverstarter-2.0.1.jar nogui
ExecStop=/usr/bin/screen -p 0 -S mc-%i -X eval 'stuff "say SERVER SHUTTING DOWN IN 5 SECONDS. SAVING ALL MAPS..."\015'
ExecStop=/bin/sleep 5
ExecStop=/usr/bin/screen -p 0 -S mc-%i -X eval 'stuff "save-all"\015'
ExecStop=/usr/bin/screen -p 0 -S mc-%i -X eval 'stuff "stop"\015'
[Install]
WantedBy=multi-user.target
If there's any other data needed I'll be happy to provide it.
Thanks in advance.