Dragonwilds:Dedicated Servers/Linux
More actions
Linux-based Dragonwilds:Dedicated Servers can be set up with the following code (created by MikeWho3) and instructions below.
- This is a systemctl service, and requires you to create and/or modify the user.
- The user is
dragonwilds
- The user is
<syntaxhighlight lang='systemd'> [Unit] Description=RuneScape Dragonwilds Dedicated Server Wants=network-online.target After=network-online.target
[Service]
- Run as the server user, not root
Type=simple User=dragonwilds Group=dragonwilds
- The directory where the files live
WorkingDirectory=/home/dragonwilds/rs_server
- 0. Ensure our safe, isolated backup directory exists
ExecStartPre=/bin/mkdir -p /home/dragonwilds/dragonwilds_backups
- 1. Backup the config to the safe folder
ExecStartPre=/bin/bash -c "cp /home/dragonwilds/rs_server/RSDragonwilds/Saved/Config/LinuxServer/DedicatedServer.ini /home/dragonwilds/dragonwilds_backups/DedicatedServer.ini.bak || true"
- 2. Run SteamCMD update without the stupid destructive 'validate' flag
ExecStartPre=/home/dragonwilds/steamcmd/steamcmd.sh +force_install_dir /home/dragonwilds/rs_server +login anonymous +app_update 4019830 +quit
- 3. Restore the saved config file from the safe folder
ExecStartPre=/bin/bash -c "cp /home/dragonwilds/dragonwilds_backups/DedicatedServer.ini.bak /home/dragonwilds/rs_server/RSDragonwilds/Saved/Config/LinuxServer/DedicatedServer.ini || true"
- 4. Guarantee script is executable (in case SteamCMD wipes the permissions)
ExecStartPre=/bin/bash -c "chmod +x /home/dragonwilds/rs_server/RSDragonwildsServer.sh"
- The command to start the server
ExecStart=/home/dragonwilds/rs_server/RSDragonwildsServer.sh -log -NewConsole -Port=7777
- If the server crashes or is killed, restart it after 15 seconds
Restart=always RestartSec=15
[Install] WantedBy=multi-user.target </syntaxhighlight>