LGSM with oxide

Linux hosted servers
Post Reply
DJ-YpDutch
Admin
Admin
Posts: 31
Joined: 01-02-2017 11:47

LGSM with oxide

Post by DJ-YpDutch » 02-02-2017 10:38

System requirements

RAM
A Rust game server uses from 6 to 12GB RAM, depending on your map size.
For that matter, LGSM warns you if you have less than 4GB available.

CPU
It will use constantly around 50% of one core from a Xeon E5-1650V3 (6 cores 12 threads, 3.8Ghz), or around 30% of one core from an I7 4870K, regardless of the amount of people connected and with very few constructions on it. As most game servers, it seems like it's mainly monothreaded, so you'd better have some good monothread performance.

Bandwidth
Bandwidth shouldn't be an issue, aim for a 10mb/s+ upload speed minimum

Other notes
The server autosave can cause lags, depending on your CPU and disk speed. An SSD server with a very good CPU can help.
It is highly recommended a dedicated server is used with Rust because of its high system requirements.

Conclusion
Don't take an inappropriate server with 150 cores @1,2Ghz, prefer a quad/hexa core @+3,3Ghz, check benchmarks before choosing your server. CPU: good monothread performance ;RAM: 12-16GB and more; avoid VPS.

Linux Distribution
You will need Glibc greater or equal to v2.15 (more info glibc · GameServerManagers/LinuxGSM Wiki · GitHub )

So you need:
Debian 8 or greater (advised)
Ubuntu 12.04 LTS or greater
CentOS 7 or greater



LGSM Tutorial (You can check this out at [url]https://gameservermanagers.com/lgsm/rustserver/[/url])
0) Make sure you have all the dependencies
And make sure you match the distro requirement by carefully reading instructions at: rustserver: Rust |

1) Make a new user and login to it
As root, do:

adduser rust
[...]
su - rust

2) Get LGSM and make it executable
wget https://gameservermanagers.com/dl/rustserver
chmod +x rustserver
3) Run the installer and follow the instructions
./rustserver install
4) Edit rustserver to fit your needs
You'd better use nano or vim, but you could also use a text editor like notepad++, which is way less convenient. If you need help about what to configure, watch the video.

nano rustserver
5) Edit server.cfg
nano serverfiles/server/rust-server/cfg/server.cfg
6) Make sure everything is alright
Start your server

cd ~
./rustserver start
Then check your logs

cat serverfiles/game*.log
Since Rust have no console, you can use this workaround to display the log in real time:

tail -f serverfiles/game*.log`
Since Rust don't allow setting a custom log location, the log file will be called game-{FULL-CURRENT-DATE}.log to not be erased on every restart and will be moved to log/server upon any server start/restart and a new one will be created.

Note: The Rust console is empty under Linux. You'll have to use an RCON tool and/or watch your logs.

7) Install Oxide
As a reminder, Oxide is an API allowing you to run mods for you Rust server.

LGSM now handles Oxide for Rust natively, with mods-install and mods-update commands.

./rustserver mods-install
rustoxide
Then you'd better check your logs again after restarting the server to check that Oxide is loading properly.

If a Rust update has been released, then an Oxide update will soon follow. To update Oxide, you can then run:

./rustserver mods-update
8.) Install Oxide addons
Just put them into serverfiles/server/rust-server/oxide/plugins They will load automatically.
If you need to edit their configs, it will be located in : serverfiles/server/rust-server/oxide/config
If you updated an addon and wish to reload it without restarting the server, you'll need to input it in an RCON tool. Once you've got it, run :

oxide.reload PluginName

9) Send RCON commands:
You will need a tool to send RCON. Here are 3 of them:

Rusty: Rusty - Server RCON administration tool | Oxide
Rustadmin: RustAdmin - Rust server RCON administration tool
Facepunch web tool: Websocket Rcon
To use an external software like Rusty or Rustadmin, you need to alter rustserver script with rconweb="0". To use Facepunch tool, leave it at default rconweb="1"

Note: Facepunch web tool currently don't accept domain names, you need to enter server IP.

If you can't remember the RCON port you set or password (that you MUST change), just use:

./rustserver details
Essential commands:

save ; will save the server state (useful before a stop or restart)
oxide.reload PluginName ; will reload a plugin after updating it
server.writecfg ; to save config commands you ordered into Rusty, including new admins
ownerid STEAMID64 "Nickname" "Reason" ; to add an owner
moderatorid STEAMID64 "Nickname "Reason" ; to add a moderator

10) Avoid a security breach and allow you to run multiple servers
By default, a user can see all started processes from other users, which is bad, but also their start parameters, which is pretty dangerous. Those start parameters can contain sensitive information, such as RCON password, Steam API keys, GSLTokens... Upon start, a Rust dedicated server is checking if the process name started by any user, and will prevent you from running it again if it finds it, displaying "Player is already running".

To avoid that, run:

mount -o remount,rw,hidepid=2 /proc
And to keep the changes upon machine reboot:

nano /etc/fstab
# Here are the modification to apply to the "proc" line
proc /proc proc defaults,hidepid=2 0 0
Of course, you still need to make one user per server, change ports, and repeat the install process. (See Multiple Servers · GameServerManagers/LinuxGSM Wiki · GitHub for more info)

11) Setup automated tasks (reboot, update...)
You will need to use Linux Cronjobs. For more information, see Cronjobs · GameServerManagers/LinuxGSM Wiki · GitHub

Basically, I advise you to setup root cronjobs. The syntax for root cronjobs is (replace things between <> by the actual value)

* * * * * su - <username> -c '/home/<username>/rustserver <command>' > /dev/null 2>&1
Example for a restart every day at 5: Login to Root (su command), then do:

crontab -e
0 5 * * * su - rust -c '/home/rust/rustserver restart' > /dev/null 2>&1

# save and exit (ctrl +x, y, enter if using nano)
You can run a monitor cronjob every few minutes to make sure your server is up and runing.

*/3 * * * * su - rust -c '/home/rust/rustserver monitor' > /dev/null 2>&1
12) Updating Rust
Just run

./rustserver update
If needed, run

./rustserver validate
To wipe the server run

./rustserver wipe
To update Oxide, that your previously installed with LGSM, run

./rustserver mods-update
Kind Regards,


Dj-YpDutch

Founder of Supreme Rust

Post Reply