![]() ![]() Systemctl enable minecraft - start this service at bootĪs for being able to run console commands, it depends on how the service is handled. Systemctl stop minecraft - stop the service Systemctl starts minecraft - start the service Systemctl status minecraft - get the current status If you created the service with the name 'minecraft', you would be able to use commands like: If you drop the file in the right folder for your distribution (/etc/systemd/system), you will be able to control the service using the systemctl or service commands. There are different things you can configure here, such as TimeoutStopSec which lets you configure how long the service is left to shutdown when you run the 'stop' command before it kills the proccess. WorkingDirectory=/home/user/bedrock-server-1.14.60.5ĮxecStart=/bin/sh -c "LD_LIBRARY_PATH=./bedrock_server" I haven't tested this, but following the standard syntax, you'd want something along these lines: Systemd files follow a standard format, where you mainly have to substitute the correct values in. So what you probably want a Systemd file. Initialisation scripts vary dependant on what version of what distribution you are using, but I believe most modern versions of Ubuntu are using systemd. ![]() I based my solution partially on this code. Then I can run whatever native commands I need. If I need to run other commands on the server, I can connect to the screen session like so. WorkingDirectory=/home//bedrock-server-1.14.60.5ĮxecStart=/usr/bin/screen -dmS UbuntuMinecraft /bin/bash -c "LD_LIBRARY_PATH=./bedrock_server"ĮxecStop=/usr/bin/screen -Rd UbuntuMinecraft -X stuff "say Stopping server in 10 seconds.\r"ĮxecStop=/usr/bin/screen -Rd UbuntuMinecraft -X stuff "stop\r" $ cd /home//bedrock-server-1.14.60.5
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |