Quantcast
Channel: Using screen command with aws ec2 start-up script doesn't work - Ask Ubuntu
Viewing all articles
Browse latest Browse all 2

Answer by Mateus Cerqueira for Using screen command with aws ec2 start-up script doesn't work

$
0
0

It ended up being a permission issue. AWS EC2 start-up scripts runs as root, therefore it was not able to find the java command neither the minecraft folder, because those were accessible only from the ec2-user (which was the one that i ssh'ed with)

So the solution was to change the command from the start-server-on-boot.sh script that sits inside /var/lib/cloud/scripts/per-boot to the following:

runuser -l ec2-user -c 'screen -dmS "minecraft" ~/minecraft/start_server.sh'

That way it was able to find both the minecraft folder and the java command and the screen session got created with the server up


Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>