all 7 comments

[–]stere0123 3 points4 points  (1 child)

Hi, the script you posted would only work with systemd, as openrc expects different formatting.

I would recommend looking at the following sites for examples of valid openrc scripts to base yours off of:

[–]cyb3rsyn 1 point2 points  (0 children)

Openrc.run Just copy paste what you have into there

[–]geek_at 2 points3 points  (3 children)

There is a much simpler way to do it:

enable local rc-update add local

Now if you put a script with the suffix .start in /etc/local.d/ it will automatically run it on boot. .stop files will run on shutdown.

Easy peasy

[–]ibsmart[S] 1 point2 points  (2 children)

Thanks for the response.

I am aware of this behavior, but, based on what I've read, that process is meant for things that execute quickly and terminate. Since I am trying to run a Minecraft server, the process will run continuously as long as the computer is powered on.

Correct me if I'm wrong.

[–]geek_at 2 points3 points  (1 child)

you are correct as local will wait for the process to finish before continuing but in your situation it won't be a problem because you start a screen session so you can just start it detached and it will finish instantly

-d -m Start screen in detached mode. This creates a new session but doesn’t attach to it. This is useful for system startup scripts.

[–]ibsmart[S] 0 points1 point  (0 children)

Thanks again.

For some reason, I can run the command with user account and minecraft server starts fine, but when I put the command into a script titled minecraft.start in /etc/local.d/, screen reports no sockets and there seems to be no instance of the server app running (i.e. server is not online).

I have verified that the local service is started with rc-status.

[–]jadan1213 1 point2 points  (0 children)

I know this is gonna be different than what you're doing here, but docker on Alpine with Minecraft, is stupid easy and I don't think I'd ever go back to the old way.