I configured a Minecraft server to run at startup inside a screen session. I'm on an EC2 AWS Instance.
I would like to stop it at shutdown, so I created the following file inside /etc/init.d
/usr/bin/logger ServerShutdownScript_START
/usr/bin/screen -S minecraft -X stuff "`echo -ne "stopr"`"
sleep 10s
/usr/bin/logger ServerShutdownScript_STOP
and symlinked it inside /etc/rc0.d/ with
sudo ln -s /etc/init.d/ServerShutdownScript /etc/rc0.d/K01ServerShutdownScript
the problem is, the script is not running nor logging to /var/log/messages with the logger command.
The Minecraft Server logs shows it being abruptly stopped or not saving the world before shutting down.
How can I make the script run and wait for the MC Server to gracefully stop?
PS: The script runs fine if I manually run it as root
Recent Questions...
ما را در سایت Recent Questions دنبال میکنید
برچسب:
نویسنده: استخدام کار
بازدید: 314
تاريخ: شنبه
12 تير
1395 ساعت: 18:50