Running Cuberite at startup on a Raspberry Pi
#2
Thank you for sharing. Let me share my approach, just in case it helps anyone.

I have a Raspberry Pi 2B running Arch Linux ARM. Since the Pi 2 has an ARMv7 processor, I had to compile the Cuberite server myself (which turned out to be pretty easy). Once Cuberite had been compiled, I moved the compiled Server directory to /srv/cuberite because it seemed (kind of) appropriate.

Just like the OP I created a 'mincraft' Linux user and made it the owner of all Cuberite files:

Code:
$ sudo chown -R minecraft:minecraft /srv/cuberite

Arch Linux uses Systemd as init sytem, so I wanted to use that to automatically start Cuberite. That's why we need a systemd unit file like this:

Code:
[Unit]
Description=Cuberite Server
After=local-fs.target network.target

[Service]
Type=forking
User=cuberite
WorkingDirectory=/srv/cuberite
ExecStart=/srv/cuberite/Cuberite --service

[Install]
WantedBy=multi-user.target

Save this as the file /etc/systemd/system/cuberite.service. It took a while before I had figured out the correct settings, but as you can see there is no magic going on here.

Finally, test if it works my starting the service:

$ sudo systemctl start cuberite.service

You should now be able to reach the server. If it works, enable the service to make sure it is started automatically:

$ sudo systemctl enable cuberite.service

By the way, this method does not provide a way to attach to the console, or at least I haven't found it yet Cool
Enjoy!
Reply
Thanks given by: LogicParrot , sphinxc0re


Messages In This Thread
RE: [Guide] - Running MCServer at startup on a Raspberry Pi - by marcvangend - 01-27-2016, 08:16 AM



Users browsing this thread: 1 Guest(s)