Skip to content

Instantly share code, notes, and snippets.

@tingtt
Last active February 28, 2024 00:32
Show Gist options
  • Save tingtt/467dba0af051d35e12c337663f9f4524 to your computer and use it in GitHub Desktop.
Save tingtt/467dba0af051d35e12c337663f9f4524 to your computer and use it in GitHub Desktop.
PalServer cloud-init sample
package_upgrade: true
packages:
- nfs-common
- lib32gcc-s1
chpasswd:
list: |
root:password
steam:password
expire: false
runcmd:
- |
mkdir /usr/local/lib/steamcmd
cd /usr/local/lib/steamcmd ; \
curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf - ; \
/usr/local/lib/steamcmd/steamcmd.sh +quit
useradd -m steam -s /bin/bash
sudo -u steam mkdir -p /home/steam/Steam
sudo -u steam cp -r /usr/local/lib/steamcmd/public /home/steam/Steam/public
tee -a /home/steam/.bashrc <<EOF
export LD_LIBRARY_PATH=/usr/local/lib/steamcmd/linux32:/usr/local/lib/steamcmd/linux64:/usr/local/lib/steamcmd/siteserverui/linux64
EOF
sudo -u steam /usr/local/lib/steamcmd/steamcmd.sh +login anonymous +app_update 2394010 validate +quit
sudo -u steam mkdir -p /home/steam/Steam/steamapps/common/PalServer/Pal/Saved
tee -a /etc/fstab <<EOF
<ip>:/srv/nfs/PalServer/01/Pal/Saved /home/steam/Steam/steamapps/common/PalServer/Pal/Saved nfs defaults,user=steam 0 0
EOF
mount -a
chown steam:steam /home/steam/Steam/steamapps/common/PalServer/Pal/Saved
mkdir -p /usr/local/lib/systemd/system
tee /usr/local/lib/systemd/system/PalServer.service <<EOF
[Unit]
Description=https://tech.palworldgame.com
After=network-online.target
[Service]
ExecStart=/home/steam/Steam/steamapps/common/PalServer/PalServer.sh -useperfthreads -NoAsyncLoadingThread -UseMultithreadForDS
WorkingDirectory=/home/steam/Steam/steamapps/common/PalServer
Restart=always
User=steam
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable --now PalServer.service
@tingtt
Copy link
Author

tingtt commented Feb 28, 2024

Lines 23 to 28 (NFS mount settings)

There are setup scripts for using nfs.
If you do not need it, delete it.

You can specify the mount source with <ip>:/srv/nfs/PalServer/01/Pal/Saved on line 25.
Please rewrite it by yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment