Linux setup
setting up with 22.04 Ubuntu
https://linuxgsm.com/servers/pwserver/
Create a user and login.
sudo adduser pwserver
#what is displayed
Adding user `pwserver' ...
Adding new group `pwserver' (1002) ...
Adding new user `pwserver' (1002) with group `pwserver' ...
Creating home directory `/home/pwserver' ...
Copying files from `/etc/skel' ...
New password:
Retype new password:
passwd: password updated successfully
Changing the user information for pwserver
Enter the new value, or press ENTER for the default
Full Name []:
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n] Y
usermod -aG sudo pwserver
su pwserver
Download linuxgsm.sh.
wget -O linuxgsm.sh https://linuxgsm.sh && chmod +x linuxgsm.sh && bash linuxgsm.sh pwserver
Run the installer following the on-screen instructions.
./pwserver install
start/stop/restart
./pwserver start
./pwserver stop
./pwserver restart
Auto Start
You need to create a service file in
/etc/systemd/system/
Example pwserver.service
sudo nano /etc/systemd/system/pwserver.service
[Unit]
Description=LinuxGSM Palworld Server
After=network-online.target
Wants=network-online.target
[Service]
Type=forking
User=ts3server
WorkingDirectory=/home/ts3server
#Assume that the service is running after main process exits with code 0
RemainAfterExit=yes
ExecStart=/home/ts3server/ts3server start
ExecStop=/home/ts3server/ts3server stop
Restart=no
[Install]
WantedBy=multi-user.target
ctrl+x then y
You need to reload the systemd-daemon once to make it aware of the new service file by
systemctl daemon-reload
Now you can do
systemctl start ts3server # Start the server
systemctl stop ts3server # Stop the server
systemctl enable ts3server # Enable start on boot
systemctl disable ts3server # Disable start on boot
Auto updates
- Monitor your server every 5 minutes.
- Check for an update every 30 minutes, update and restart only if an update is detected.
- Update check and update LinuxGSM every Sunday at 1am.
- Restart at midnight, 6am, noon and 6pm.
crontab -e
add these to bottom
*/5 * * * * /home/pwserver/pwserver monitor > /dev/null 2>&1
*/30 * * * * /home/pwserver/pwserver update > /dev/null 2>&1
0 01 * * 0 /home/pwserver/pwserver update-lgsm > /dev/null 2>&1
0 0,6,12,18 * * * /home/pwserver/pwserver restart > /dev/null 2>&1
to change restart times use site below.
https://crontab.guru/#0_0,6,12,18_*__
https://crontab.guru/#0_0,6,12,18_*__
Auto back up
- Will backup savefiles every 10 mintues with time stamp.
make this file in home dir
nano backup.sh
#!/bin/bash
rsync -avh "/home/pwserver/serverfiles/Pal/Saved/SaveGames/0/" "/home/pwserver/backup/$(date)/"
mkdir backup
chmod 777 backup
Add this line to crontab
*/10 * * * * /home/pwserver/backup.sh > /dev/null 2>&1
*/5 * * * * /home/pwserver/pwserver monitor > /dev/null 2>&1
*/30 * * * * /home/pwserver/pwserver update > /dev/null 2>&1
0 1 * * 0 /home/pwserver/pwserver update-lgsm > /dev/null 2>&1
0 0,6,12,18 * * * /home/pwserver/pwserver restart > /dev/null 2>&1
*/10 * * * * /home/pwserver/backup.sh > /dev/null 2>&1