Cuberite Forum
I can't keep the server online on a VPS/Dedicated Server - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html)
+--- Forum: Discussion (https://forum.cuberite.org/forum-5.html)
+--- Thread: I can't keep the server online on a VPS/Dedicated Server (/thread-2019.html)



I can't keep the server online on a VPS/Dedicated Server - Nixtren - 06-20-2015

Hello people,

I'm running MCServer/Cuberite on my VPS and everything seems to be working great, except one thing. I'm connected to it via SSH (Linux), if I run the server and disconnect myself from the VPS, Cuberite goes off (as expected with any process).

I have tried running the following commands to keep MCServer/Cuberite online, and it looks like it keeps running, but apparently it doesn't answer to ping requests nor allow players to join:

Code:
./MCServer &
nohup ./MCServer &

I'm running CentOS 7 64-Bits with Cuberite binaries compiled from source.

Is anyone else having this problem or just me? Is there any solution to this?

Thanks in advance! Smile


RE: I can't keep the server online on a VPS/Dedicated Server - SamJBarney - 06-20-2015

I used to run it using the screen command, and that worked out for me.


RE: I can't keep the server online on a VPS/Dedicated Server - Mathias - 06-20-2015

Although this is not an exact solution or answer to why the problem is occurring, I suggest using screen or tmux.
https://www.gnu.org/software/screen/
http://tmux.github.io/


RE: I can't keep the server online on a VPS/Dedicated Server - Nixtren - 06-20-2015

Thank you both, I have tried screen and it works Smile

For those who have the same problem as me:
Run "screen" (you might need to install it), run the server and then detach the screen (CTRL+a and then d).


RE: I can't keep the server online on a VPS/Dedicated Server - worktycho - 06-20-2015

You can also use the built in -d option, which daemonizes the server.


RE: I can't keep the server online on a VPS/Dedicated Server - LogicParrot - 06-20-2015

Use Tmux or screen. I made a guide for Tmux here.
TL;DR:
1. Install Tmux in the server.
2. SSH into the server.
3. type "tmux".
4. Type anything you please in the virtual terminal that opens up, (in this case, ./MCServer).
5. Hit Ctrl-B, then D to detach from the virtual terminal and send it to the background.
6. You can log out now and the server will still live on in the virtual terminal.
7. To check the server console or shut it down, attach to the terminal by ssh'ing into the server again and then typing "tmux attach".


RE: I can't keep the server online on a VPS/Dedicated Server - Jammet - 06-21-2015

Always used screen and a simple start/stop script. Works like a charm. Combine that with a dyndns auto update script and a backup script and you can leave for a year and come back and see that NOTHING works as planned! ;D

Well you can leave this unattended ... for a while Wink.