0

I'm a total Linux beginner and just started playing around with Ubuntu Server without GUI this week, and encountered a little problem.

I have a script that starts game server ServerStart.sh that was changed to executable and it works great (players can connect etc.). I've even added it to crontab to start at server reboot, but as it runs in terminal I can't do anything else on the system. Is there any way to run it in background or as a service? Also I want to access this game server directly as in terminal/console I can change permissions for users, difficulty etc (Script starts Minecraft server). Probably it's easy, but I can't find instructions for dummies for it. Does somebody has as easy as possible solution to it?

If anybody wants to see how the server files look: FTB server

Zanna
  • 69,223
  • 56
  • 216
  • 327
Stablo
  • 1
  • 3
    Possible duplicate of [Running programs in the background from terminal](https://askubuntu.com/questions/106351/running-programs-in-the-background-from-terminal) – pLumo Jul 04 '19 at 11:51
  • 3
    You said that you added your script to crontab.Every job that is run by cron is run in the background automatically. So it is not logical that your script still runs in the terminal.. Would you share how did you add the script to crontab? – singrium Jul 04 '19 at 13:00

1 Answers1

0

You will want to use the screen package. Screen is a terminal application that you can send to the back, very useful for remote systems.

You can install it with 'sudo apt-get install screen' and use it like:

screen it opens screen

do whatever cli command you want

And send screen to the back with ctrl + A + D.

You can retrieve a screen instance with ctrl + r.

Dr_Bunsen
  • 4,663
  • 4
  • 27
  • 40