I'm new to linux (a few months). I have set up pocket minecraft server on a raspberry pi. The pi has no display and is permanently on beside our home router (static ip). I ssh to do everything on it. If I run the start.sh then close my ssh terminal, the process/server stops. So..... how do I get the start.sh to run all the time when the pi starts up?
The easy way is to use screen, the best way is to start PM as a service like this for example (untested):
crontab is for scheduled tasks that repeat on a regular basis - screen is probably the best option for you as PM will keep running when you close your ssh session, and it's really easy to log back into the same screen session to continue where you left off.
Raspberry pi is based on debian jessie which uses systemd. You can run pocketmine as a systemd service with this script: -----start script----- [Unit] Description=PocketMine MineCraft Server [Service] User=pi ExecStart=/home/pi/pocketmine/start.sh 1>/dev/null 2>&1 WorkingDirectory=/home/pi Restart=always RestartSec=5s [Install] WantedBy=multi-user.target -----end script----- Make sure you change the user and path to the ones on youre system. Put this script, everything between the "start script" and "end script" lines in this file and directory: /etc/systemd/system/pocketmine.service Execute this command to enable the service: sudo systemctl enable pocketmine And you can control pocketmine with these commands: sudo service pocketmine start sudo service pocketmine stop sudo service pocketmine restart
Right, update time. Awzaw, thanks for putting me onto screen. It seems the best solution for me to leave the server running and interact with it when I need to. It is also seems useful for other linux things. About a year ago I made the leap to linux for my whole family and it has been a learning curve. Sorry, this isn't a linux forum, its a minecraft one. Reading through this forum has enabled me to get a server up and running for one of my sons and HE LOVES IT! It's brilliant that we can play together, and then I can build when he is asleep, so he can see cool things in the morning. To be fair, I think they are cool. He just fills them with water, blows them up, or attacks me with zombies. Thank you all for your replies, and thank you for those who have posted in other threads which I have read.