I'm trying to figure out how to get my Minecraft server to start with my system. I'm currently on Ubuntu 21.04, kernel 5.11 and my DE is Gnome 3. I was following this post over on the Ubuntu StackExchange to setup a Minecraft service in systemd, after a lot of tinkering I was able to get it to start, but I get Java error's, and The server says I need to accept the eula even though I already have.
Here is what's in my /etc/systemd/system/minecraft.service file:
Description=Minecraft server
Wants=network.target
After=local-fs.target network.target
[Service]
User=minecraft
Group=minecraft
UMask=0027
EnvironmentFile=/etc/conf.d/minecraft
KillMode=none
SuccessExitStatus=0 1 255
NoNewPrivileges=true
PrivateDevices=true
PrivateTmp=true
ProtectHome=true
ProtectSystem=full
ExecStart=/usr/bin/java -Xms2G -Xmx3G -jar /etc/conf.d/Minecraft/server.jar --nogui
# ExecStop=/usr/bin/mcrcon -H localhost -p ${RCON_PASSWD} stop
[Install]
WantedBy=multi-user.target
I know some stuff could be removed from it, like the EnvironmentFile since I'm not using it, but I haven't finished trimming this down yet.
Now here's what my terminal shows when I run sudo systemctl status minecraft.service:
Loaded: loaded (/etc/systemd/system/minecraft.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Wed 2021-05-12 21:25:55 EDT; 14min ago
Process: 5036 ExecStart=/usr/bin/java -Xms2G -Xmx3G -jar /etc/conf.d/Minecraft/server.jar --nogui (code=exited, status=0/SUCCESS)
Main PID: 5036 (code=exited, status=0/SUCCESS)
May 12 21:25:50 terrys-nas java[5036]: at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:45)
May 12 21:25:50 terrys-nas java[5036]: at org.apache.logging.log4j.LogManager.getContext(LogManager.java:194)
May 12 21:25:50 terrys-nas java[5036]: at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:551)
May 12 21:25:50 terrys-nas java[5036]: at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:537)
May 12 21:25:50 terrys-nas java[5036]: at net.minecraft.server.Main.<clinit>(SourceFile:57)
May 12 21:25:50 terrys-nas java[5036]: 2021-05-12 21:25:50,764 main ERROR Null object returned for RollingRandomAccessFile in Appenders.
May 12 21:25:50 terrys-nas java[5036]: 2021-05-12 21:25:50,773 main ERROR Unable to locate appender "File" for logger config "root"
May 12 21:25:55 terrys-nas java[5036]: [21:25:55] [main/ERROR]: Failed to store properties to file: server.properties
May 12 21:25:55 terrys-nas java[5036]: [21:25:55] [main/INFO]: You need to agree to the EULA in order to run the server. Go to eula.txt for more info.
May 12 21:25:55 terrys-nas systemd[1]: minecraft.service: Succeeded.
The version of Java that I'm using is openjdk version "1.8.0_292", and the server runs just fine if I start it manually.
I Did some more playing around, decided to clear out the entire Minecraft directory and just leave the server.jar in it hoping it would recreate the files for me then I could go in and edit them, it didn't. Just server.jar in the directory.
If you need any other information about my setup let me know, thanks for your time.
sudo nano eula.txt
in the directory where the server.jar is, puteula=true
and restarted the system, still didn't work. EDIT: Looks like the comment I was replying to is gone? I'm new to this site so I'm not sure how it all works.