kz6fittycent / mc-server-installer

Minecraft Server Installer
MIT License
6 stars 4 forks source link

How to auto-start the server as a service using the snap? #10

Closed ykoehler closed 1 year ago

ykoehler commented 1 year ago

How do one launch the server in the background as a service after having it installed ?

kz6fittycent commented 1 year ago

It's possible but not implemented in this snap. It is intended for beginners who want to just get it up and running. That said, you can do the following to "cheat":

  1. open a terminal and run screen (you may have to install it)
  2. this will start mc-server-installler and run it in the background
  3. then just run the mc-server-installer command and choose your option
  4. Finally, using your keyboard, type CTRL+A and D at the same time. This will detach the terminal, and allow the process to continue running until you reboot or kill.

To return to the screen from which you detached, just run screen -r and it'll take you right back.

Here's the man page on screen for more reference: https://linux.die.net/man/1/screen