I'm trying to use a script to start my Minecraft server on a detached screen. I have a start.sh file setup as per instructions:


screen -d -m -S minecraft java -Xms6G -Xmx6G -jar spigot-1.15.2.jar

After I execute start.sh, I check my screen list my Minecraft screen does not exist. If I cut out the screen bit the script works exactly as intended (screen also works just fine on its own). I'm not too experienced with bash, I may need an ELI5.

edit: some clarification

  • Is screen installed? – user535733 Mar 27 at 14:12
  • @user535733 Yes. I use it to run a few other scripts, but every time I have to manually create the screens and then detach. That's why I'd like to make a script to start the screen. – Bryan Mar 27 at 14:14
  • You made the script executable? You get NO error messages or warnings? – user535733 Mar 27 at 14:16
  • Yeah it's executable and runs just fine if its only the java -Xms6G -Xmx6G -jar spigot-1.15.2.jar bit. If I include the screen part, it just does nothing. No error, no warning, no screen created. – Bryan Mar 27 at 14:20
  • Just figured something out. I was running the start.sh with sudo because the jar won't run otherwise. If I just run the script without sudo, the screen is created, but now the jar doesn't have permission to run. What's the workaround? – Bryan Mar 27 at 14:32

Yeah so it was a permissions issue. The directory was owned by root:root just changed it to my user/group.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.