Sockets=xxx contains the name of the Socket you created above, correct? It will still send SIGKILL after a certain time unless you add some more parameters (man systemd.kill).
![minecraft server commands minecraft server commands](https://static.planetminecraft.com/files/resource_media/screenshot/1706/2017-02-09_15064010844239_lrg.png)
This prevent sending SIGTERM to the server process and cause a premature stopping of the process. Why do we have to use KillSignal=SIGCONT? Here are some clarifications from suggestions of the original author. service file, it is automatically added by the Sockets= option, the BindsTo= option will take care of stopping the socket and cleaning up the FIFO file when the service stops.
![minecraft server commands minecraft server commands](https://i.ytimg.com/vi/aIcJ-X51K_c/maxresdefault.jpg)
You don't have to take care of adding dependencies to the. ĮxecStart=/bin/sh -c "exec /usr/local/bin/services/minecraft/run.sh /run/ntrol"īonus, you'll be able to send command to the server using echo "/command" > /run/ntrol anytime. Then ExecStop will simply write to the new socket to send "/stop\n" to the input. Then modify your rvice file to not send SIGTERM, bind standard input to the socket by modifying ExecStart with an exec wrapper. Additionally, the unit's ExecStop command echo "/stop" > /run/ntrolĭoes not work either and the server gets killed by the sigkill signal instead.Īdd a new minecraft.socket file (assuming your service is named rvice) to bind your server's input to: If there's no output in the fifo, the journal of the rvice unit displays Unknown command. Sometimes gives me an output when viewing the ntrol fifo (with cat) and sometimes not. When sending a command using echo "/help" > /run/ntrol Unfortunately, the commands passed through the ntrol fifo do not work.
#Minecraft server commands how to#
Unfortunately I could not figure out how to modify the ExecStop command to send internal commands to the minecraft process.ĮxecStart=/bin/sh -c "java -Xms2G -Xmx4G -XX:+UseConcMarkSweepGC -jar spigot-1.14.4.jar /run/ntrol"
![minecraft server commands minecraft server commands](https://static.planetminecraft.com/files/resource_media/screenshot/1519/2015-05-09_1847448907947_lrg.jpg)
I've read that simply using the kill command will not terminate the server gracefully and one should use the minecraft-internal "stop" command instead. WorkingDirectory=/usr/local/bin/services/minecraft/ĮxecStart=/usr/local/bin/services/minecraft/run.sh Everything seems to work but I assume the way I'm terminating the server on stop command is not the best one. I'm building up my linux knowledge (at least I'm trying) by setting up services for different game servers.Ĭurrently I'm working on a Minecraft Server that shall be started automatically on a server restart.