trevor-laher / OnDemandMinecraft

An AWS hosted Minecraft server that will only run when players are active. Players can start the server through a simple UI accessed through free Heroku server hosting.
MIT License
516 stars 69 forks source link

EC2 Instance Not Shutting Down #34

Open SebastianKurp opened 4 years ago

SebastianKurp commented 4 years ago

Hey! So I followed the readMe and setup everything. The server itself is running fine, but the autoshutdown feature is not working.

The way I have been testing auto shutdown is:

Could this be an issue with no one joining the server? Have not tested that use case yet.

Edit does the colon at the end matter? image

I also ran sudo crontab /home/ubuntu/crontab -u ubuntu via the web based ssh, I believe it ran successfully but no message return in the terminal

dvghm commented 4 years ago

@SebastianKurp, I don't know your setup, but one thing to look out for that I impacted me. If you are using Windows (and followed the readme without really thinking like I did), there is a good chance that the instanceSetup files you ftp'd to your ec2 instance have dos eol characters. I converted autoshutdown.sh and crontab from dos to unix files, reloaded my crontab and everything seems to be working. Also, don't forget to 'chmod 700 autoshutdown.sh'

I had one glitch where it appeared that server.jar stopped responding (executing screen -S minecraft -p 0 -X stuff "list^M"'' returned to output). But other than that, it seems to be working (knock on wood).

SebastianKurp commented 4 years ago

Ahhhh that makes sense, I was building on mac. Thanks for the tip!

ron4821 commented 4 years ago

Seeing as I am having the same issue and this wasn't resolved with the above suggestion. What else could be wrong with the script? It isn't cron, because cron is kicking off the script. And when I execute ./autoshutdown.sh it shows this... image