Digital Paint Discussion Board
Paintball 2: The Game => Server Discussion => Topic started by: ic3y on November 01, 2013, 04:20:42 PM
-
BASIC
Use a ssh program like Putty (Link (http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html)) (necessary if you use Windows)
Guide based on b46, should work with any linux_full version. Check ftp://otb-server.de/pub/Game/ for the newest one.
Connect to your server (Debian, commands may change on other distro) and login as root.
Attention: The server may not launch properly if the necessary libs aren't installed.
As user root:
apt update && apt dist-upgrade
apt install screen
useradd -m -s /bin/bash paintball
passwd paintball (use another password than root!)
su paintball
As user paintball:
cd
wget ftp://otb-server.de/pub/Game/paintball2_build046_linux_full.tar.gz (http://ftp://otb-server.de/pub/Game/paintball2_build046_linux_full.tar.gz)
tar xvf paintball2_build046_linux_full.tar.gz
cd paintball2
cp ./pball/configs/server.cfg ./pball/configs/myserver1.cfg
nano pball/configs/myserver1.cfg (This is the serverconfig for your server, you can add standard settings, logins etc here)
nano pball/configs/motd.txt (This file contains the Message of the Day, which you see when you join the server)
nano pball/configs/rotation.txt (This file containts the rotation for the server)
chmod +x paintball2
./paintball2 +set dedicated 1 +exec myserver1.cfg +set port 11111 +map arenaball
Check the serverbrowser if you see your server.
If you get an error like "paintball2 not found", read the error part.
Error
As user root:
Debian 7 and earlier:
As root:
dpkg --add-architecture i386
apt-get update
apt-get install ia32-libs
Debian 8 and newer:
As root:
dpkg --add-architecture i386
apt-get update
apt-get install build-essential gcc-multilib rpm libstdc++6 libgcc1 zlib1g libncurses5 libc6
If you want to run your server in background:
nano /home/paintball/paintball2/myserver1.sh
Copy & Paste + Modify:while true; do
./paintball2 +set dedicated 1 +exec myserver1.cfg +set port 11111 +map arenaball
done
chmod +x /home/paintball/paintball2/myserver1.sh
screen -A -m -d -S myserver1 ./myserver1.sh
Screen: Get back to the myserver1 console
Regarding screen, if you need to get back to the myserver1 console, you can use "screen -r myserver1" to restore it. "myserver1" is whatever you specified in in the after "screen -S".
screen -r myserver1
Multiple server
Just replace the highlighted green word (myserver1) with another word (a.e. match (match.cfg, match.sh, ...)) and the port in the .sh file!
Useful commands
Update your Mapfolder with wget
Public Maps
wget -N -P /home/paintball/paintball2/pball/maps ftp://www.otb-server.de/pub/Maps/*.bsp
Beta Maps:
wget -N -P /home/paintball/paintball2/pball/maps/beta ftp://www.otb-server.de/pub/Maps/beta/*.bsp
Jump Maps:
wget -N -P /home/paintball/paintball2/pball/maps/jump ftp://www.otb-server.de/pub/Maps/jump/*.bsp
Mapinfos:
wget -N -P /home/paintball/paintball2/pball/maps/mapinfo ftp://www.otb-server.de/pub/Maps/mapinfo/*.txt
-
Thats good (maybe remember to use an own password for the paintball user) :D
-
Stickied.
Regarding screen, if you need to get back to the server console, you can use "screen -r server" to restore it. "server" is whatever you specified in in the after "screen -S".
-
Copied this to the wiki. Didn't do all the formatting though. One day when I am bored I will go through and fix formatting on some wiki pages.
Since these commands don't work on all linux distros, I might make a duplicate of this guide and just replace the commands. Then there should also be a section at the top saying which distros this works on.
http://wiki.digitalpaint.org/doku.php?id=linux_server_setup_guide
-
Probably also add if running multiple screens (and hence multiple servers), that you can list them with 'screen -ls' or 'screen -list', as you may forget the names.
-
please add, that 64 bit server users have to install "libXxf86vm" , else they will get wiered error like file not found(while it exists and permission is given).
-
please add, that 64 bit server users have to install "libXxf86vm" , else they will get wiered error like file not found(while it exists and permission is given).
ia32-libs should be fine, idk you package. Which system?
-
please add, that 64 bit server users have to install "libXxf86vm" , else they will get wiered error like file not found(while it exists and permission is given).
ia32-libs should be fine, idk you package. Which system?
Maybe just include a note saying that the server may not launch properly if the necessary libs aren't installed. The required libs will be displayed after attempting to launch the server.
Installed libs will be different for every distro. I had to install glibc on my new 64bit Centos 6.3 VPS.
-
Not working for me with SUSE as distribution. I changed to Debian and it works fine.
The point on beginnig is not there.
/paintball2 +set dedicated 1 +exec server.cfg +set port 11111 +map arenaball
5 Minutes i need to look where my failure was. :) Sry my first time to handle a server.
Maybe little lines how i can restart server.
But thanks for your work. Help me alot.
-
To restart your pb server you have to check the PID of the screen.
To do it, simply type screen -ls.
Than find the screen name of your pb server.
When you will find it, just read the number before the dot and type "kill NUMBER_HERE"
To restart the server type screen -S pbserv than enter ./server.sh .
-
Hm, just a note -- you should not edit server.cfg directly, as it will be overwritten by new releases. You should rename/copy server.cfg to something like myserver.cfg or server_pub1.cfg, then customize it.
-
One small thing, instead of the some of the chmod calls, should use "script /dev/null" instead, bit more secure.
-
One small thing, instead of the some of the chmod calls, should use "script /dev/null" instead, bit more secure.
Hm, could you give an example maybe? Idk /dev/null in combination with chmod.
-
It has to do with permissions, sudo, and the "Cannot open your terminal '/dev/pts/4' - please check." error. There is no combination, you would just "script /dev/null" instead of "chmod +x filename"
/dev/null is kind of a black hole, so permission "error" is still there, but it suppresses it. The advantage from what I've seen is that the other common way, chmod +x, can give other users permission in your terminal. /dev/null keeps the screen to the current user only.
-
Can Digital Paintball server run during boot?
Also, can I install and configure the server without a GUI? I like how little system resources CentOS and Debian use. I currently run a centOS VM and its using less than 200mb ram. I might just install a gui to install DP2 and then remove the gui when I am done.
Cheers!
-
Can Digital Paintball server run during boot?
Also, can I install and configure the server without a GUI? I like how little system resources CentOS and Debian use. I currently run a centOS VM and its using less than 200mb ram. I might just install a gui to install DP2 and then remove the gui when I am done.
Cheers!
The guide dont use any gui.
-
Can Digital Paintball server run during boot?
Also, can I install and configure the server without a GUI? I like how little system resources CentOS and Debian use. I currently run a centOS VM and its using less than 200mb ram. I might just install a gui to install DP2 and then remove the gui when I am done.
Cheers!
I run my servers on Debian without any GUI.
Yeah, you can run it on boot. Every GNU/Linux has a kind of an Autostart script.
-
the download link is dead use wget http://crack-gaming.de/paintball2/Paintball%202/Paintball%202.0%20Alpha%20build041/paintball2_build041_linux_full.tar.gz
then tar xzf paintball2_build041_linux_full.tar.gz
-
downloading maps - faster way thanks to ic3y's mappack
Pub maps:
cd /home/paintball/paintball2/pball/maps
wget https://dp.mrokita.pl/files/mappacks/pubmaps_20151103.tar.gz
tar -xvzf pubmaps_20151103.tar.gz
Beta maps:
cd /home/paintball/paintball2/pball/maps/beta
wget https://htmldp.com/files/mappacks/betamaps_20151103.tar.gz
tar -xvzf betamaps_20151103.tar.gz
Jump maps:
cd /home/paintball/paintball2/pball/maps/jump
wget https://htmldp.com/files/mappacks/jumpmaps_20151103.tar.gz
tar -xvzf jumpmaps_20151103.tar.gz
-
Can Digital Paintball server run during boot?
Also, can I install and configure the server without a GUI? I like how little system resources CentOS and Debian use. I currently run a centOS VM and its using less than 200mb ram. I might just install a gui to install DP2 and then remove the gui when I am done.
Cheers!
mRokita
figured this out today
All 5 of my servers start on boot up
he made a script in the /root directory
r.sh
and runall.sh
r.sh
#cd /home/paintball/paintball2
#sudo -u paintball screen -A -m -d -S pub1 ./pub1.sh
#sudo -u paintball screen -A -m -d -S pub2 ./pub2.sh
cd /home/paintball2/paintball2
sudo -u paintball2 screen -A -m -d -S match1 ./match1.sh
#sudo -u paintball2 screen -A -m -d -S match2 ./match2.sh
#sudo -u paintball2 screen -A -m -d -S match3 ./match3.sh
runall.sh
cd /home/paintball/paintball2
sudo -u paintball screen -A -m -d -S pub1 ./pub1.sh
sudo -u paintball screen -A -m -d -S pub2 ./pub2.sh
cd /home/paintball2/paintball2
sudo -u paintball2 screen -A -m -d -S match1 ./match1.sh
sudo -u paintball2 screen -A -m -d -S match2 ./match2.sh
sudo -u paintball2 screen -A -m -d -S match3 ./match3.sh
all 5 servers now start on boot up of the linux box
thanks to mRokita and ic3y for this whole thread and the help
-
Davew_, r.sh was a copy just to test some stuff.
Small tutorial:
As user root, create /root/runall.sh and do chmod +x /root/runall.sh and then edit it with vim or any other editor.
Example:
cd /home/paintball/paintball2/
sudo -u paintball2 screen -A -m -d -S myserver1 ./myserver1.sh
Then as root, do crontab -e, pick any editor you want to use and append @reboot /root/runall.sh to the end of the file and then save it
-
so i keep doing the ./paintball2 +set dedicated........ etc and it says directory or file not found =/
-
Posting this here for future purposes and in-case someone else needs this too. For debian 8+. This creates a systemd service, that should restart the server automatically after crashing/server reboots/etc. Make sure you have tmux installed and a server config named 'server_servername.cfg'. also you need to specify the port in server config.
to re-attach server console use 'tmux -L servername attach -t servername' and to detach Ctrl+B, D
You can start multiple servers too:
systemctl start paintball@public
systemctl start paintball@match
# cat /etc/systemd/system/paintball@.service
[Unit]
Description=Digitalpaint Paintball2 Server %i
Wants=network.target
After=network.target
[Service]
User=paintball
Type=forking
PrivateTmp=false
Restart=always
RestartSec=5s
Nice=-5
WorkingDirectory=/home/paintball/paintball2/
ExecStart=/usr/bin/tmux -L %i new-session -s %i -d '/home/paintball/paintball2/paintball2 +set dedicated 1 +exec server_%i.cfg +map arenaball'
ExecStop=/usr/bin/tmux -L %i send-keys -t %i 'say SERVER SHUTTING DOWN in 5s' C-m
ExecStop=/bin/sleep 5
ExecStop=/usr/bin/tmux -L %i send-keys -t %i 'say SERVER SHUTTING DOWNl' C-m
ExecStop=/bin/sleep 2
ExecStop=/usr/bin/tmux -L %i kill-server
[Install]
WantedBy=multi-user.target
#########
# HowTo
#########
#
# Enable/Start systemd service
# systemctl daemon-reload
# systemctl enable paintball@servername
# systemctl start paintball@servername
# systemctl stop paintball@servername