I just set up a MC server on my CentOS box and so far it runs smoothly. I am running a modpack (sevtech ages) and tried building a systemd service to start and stop the server. I am also using rcon. Starting works like a charm but I cannot stop the server using systemd. Here are some outputs:
systemctl status minecraft
â minecraft.service - Minecraft Server
Loaded: loaded (/etc/systemd/system/minecraft.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Mon 2020-03-02 09:44:56 CET; 5s ago
Process: 8649 ExecStop=/opt/minecraft/tools/mcrcon/mcrcon -H 127.0.0.1 -P <myport> -p <mypassword> stop (code=exited, status=203/EXEC)
Main PID: 8522
Tasks: 42 (limit: 26213)
Memory: 4.0G
CGroup: /system.slice/minecraft.service
ââ8522 /usr/bin/java -server -Xms2048M -Xmx8192M -XX:+UseG1GC -Dsun.rmi.dgc.server.gcInterval=2147483646 -XX:+UnlockExperimentalVMOptions -XX:G1NewSiz>
Mar 02 09:43:17 lnxminecraft01 java[8522]: [09:43:17] [Server thread/INFO] [Mekanism]: Sent config to 'someuser'
Mar 02 09:43:17 lnxminecraft01 java[8522]: [09:43:17] [Server thread/INFO] [journeymap]: Sending log in packet.
Mar 02 09:43:17 lnxminecraft01 java[8522]: [09:43:17] [Server thread/INFO] [ViesCraft]: Logged in Server
Mar 02 09:43:17 lnxminecraft01 java[8522]: [09:43:17] [Server thread/INFO] [Astral Sorcery]: [Astral Sorcery] Waiting for server synchronization on login for xx>
Mar 02 09:43:17 lnxminecraft01 java[8522]: [09:43:17] [Server thread/INFO] [Astral Sorcery]: [Astral Sorcery] Synchronizing baseline information to someuser
Mar 02 09:43:18 lnxminecraft01 java[8522]: [09:43:18] [Server thread/INFO] [FML]: Unloading dimension 144
Mar 02 09:44:56 lnxminecraft01 systemd[1]: Stopping Minecraft Server...
Mar 02 09:44:56 lnxminecraft01 systemd[1]: minecraft.service: Control process exited, code=exited status=203
Mar 02 09:44:56 lnxminecraft01 systemd[1]: minecraft.service: Failed with result 'exit-code'.
Mar 02 09:44:56 lnxminecraft01 systemd[1]: Stopped Minecraft Server.
.So it tells me the server has stopped but in fact I can still connect to it and play on it. In fact, nothing happened at all. When I run the command "/opt/minecraft/tools/mcrcon/mcrcon -H 127.0.0.1 -P port -p pass stop" directly the server stops just fine (as root AND as the minecraft user), so there should be no problem with rcon or the port it is using. Any idea what might be causing the problems with systemd?
Okay, just in case anyone else runs into this problem. Funnily enough Google did not point me in this direction - this time.
After disabling SELinux, everything is running smooth as smoothstone.
To be fair this isn't my first linux project and every single time I run into problems with SELinux. I always forget about that thing. So if anyone wants to tweak theirs to work with minecraft (and rcon) feel free to do so but imho, just disable it.
Hey all!
I just set up a MC server on my CentOS box and so far it runs smoothly. I am running a modpack (sevtech ages) and tried building a systemd service to start and stop the server. I am also using rcon. Starting works like a charm but I cannot stop the server using systemd. Here are some outputs:
after stopping the server:
.So it tells me the server has stopped but in fact I can still connect to it and play on it. In fact, nothing happened at all. When I run the command "/opt/minecraft/tools/mcrcon/mcrcon -H 127.0.0.1 -P port -p pass stop" directly the server stops just fine (as root AND as the minecraft user), so there should be no problem with rcon or the port it is using. Any idea what might be causing the problems with systemd?
Okay, just in case anyone else runs into this problem. Funnily enough Google did not point me in this direction - this time.
After disabling SELinux, everything is running smooth as smoothstone.
To be fair this isn't my first linux project and every single time I run into problems with SELinux. I always forget about that thing. So if anyone wants to tweak theirs to work with minecraft (and rcon) feel free to do so but imho, just disable it.