Start Minecraft Server together with Linux?

ha
- in Servers
14

I would like to have a .sh file run automatically when Linux starts. Screen is used in this .sh file.

Ob

I would do it with a cronjob

@reboot bash /path/to/my/file.sh

then sudo service cron start

https://wiki.ubuntuusers.de/Cron/

ha

It doesn't work with my screen script in the .sh file.

Ob

What is a screen script? A script that uses the screen command?

ha

Yes exactly

Ob

Why do you need screen there at all?

ha

It doesn't run all the time without a screen, does it?

Ob

Yes, actually. You start it with cron - you don't have a terminal.

ha

So can I start it without a screen? Then I can't see a console anymore, can I?

Ob

No, I think you can't see a console when you start this thing with Cron.

ha

Is there any other option besides cron?

Ob

https://serverfault.com/questions/233084/how-do-i-use-crontab-to-start-a-screen-session

Sw

Yes you can use systemd. But you have to create a new user (runs in userspace)

ha

Can you explain that please? Can you simply write a command into the system.conf?

Sw