I then set this with PM2 (pm2 start startmine.sh) and then a 'pm2 save' command
It seems to work fine. Unfortunately, if I log into the machine, the screen session is unavailable. PM2 tells me the script is running and players can log into the game. Unfortunately, it makes it difficult to make changes to the game (such as adding an admin) since the session appears unreachable.
Is there a 'clean' way to start the game on reboots and still allow access when I ssh into the machine? I'd like to avoid installing any additional utilities (hopefully screen and PM2 are enough).
but I'm not sure if that will put all the world files in the right place if I don't cd into the minecraft directory first. I also don't know how I'd reach the minecraft cli if I ssh in (same problem as I have now)
I'm also not sure if just calling the script file from rc.local would do the trick.