OpenBSD Dedicated Server Setup

From GMod Wiki

Revision as of 22:50, 1 July 2010 by Philxyz (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Contents

OpenBSD-Logo.png OpenBSD

NOTICE: This won't work just yet unless you can find newer linux libraries than Fedora Core 4 which has glibc version 2.3

ANOTHER NOTICE: Linux server binaries are currently in beta and are not guaranteed to be updated as often as the Windows binaries. AzuiSleet is doing his best to keep them up to date.

Install Guide

Stop.png You will need to be root at one point in this guide so be careful! You can do serious damage while logged in as root.

Install Linux Compatibility

As Root, enable Linux Kernel Syscall emulation. You can skip this step if you like, since it will be done anyway when you install the fedora compatibility in the last step:

sysctl kern.emul.linux=1

Edit the file "/etc/sysctl.conf" and uncommend the line:

#kern.emul.linux=1      # enable running Linux binaries

...so that it reads:

kern.emul.linux=1       # enable running Linux binaries

...Linux kernel emulation is now enabled for each bootup of the system.

Now, we need to install some packages containing Linux libraries. Replace your.ftp.mirror with one of the OpenBSD mirror sites listed here: http://www.openbsd.org/ftp.html

export PKG_PATH=ftp://your.ftp.mirror/pub/OpenBSD/4.7/packages/i386/
pkg_add -i fedora_base
pkg_add -i gtar    (if there is a choice, choose static)
mv /bin/tar /bin/bsdtar
ln -s /usr/local/bin/gtar /bin/tar

Mount the /proc File System. Note that this is a security issue but we're doing it anyway.

mkdir /proc
mount_procfs -o rw,linux /proc /proc

You want it to be mounted at every boot, so do this:

echo "/proc /proc procfs rw,linux 00" >> /etc/fstab

Create a user

As root, execute the following commands to create a new user and set up their password

useradd -m -s /bin/sh -d /home/gmod gmod
passwd gmod

Login as gmod before continuing.

su gmod

Change to home directory:

cd

Make a folder for your server

Go to your home folder if not already there:

cd ~
mkdir srcds
cd srcds

Installing Steam

Do this bit as the "gmod" user for security reasons:

su gmod

Download the dedicated server update tool, make it executable and run it.

curl http://www.steampowered.com/download/hldsupdatetool.bin > hldsupdatetool.bin
chmod +x hldsupdatetool.bin
./hldsupdatetool.bin

You will need to agree to the terms of the license agreement - type 'yes' and press return.

Now run Steam - Providing you have an active Internet connection and the Steam servers are up, it will update itself.

./steam

Now we want to install Garry's Mod.

Installing GM10 Content

Enter the following:

./steam -command update -game orangebox -dir .
./steam -command update -game garrysmod -dir .

Installing the necessary Linux binary code

Now, download the GMod Linux server binaries from http://www.facepunch.com/showthread.php?t=933697, and save the zip file to your srcds folder and unzip them there:

unzip <filename>.zip

Next, move each of the extracted files below into the places they need to be for the server to operate:

mv server_i486.so orangebox/garrysmod/bin
mv lua_shared_i486.so orangebox/bin
mv scenecacheproxy_i486.so orangebox/bin
mv gm_sqlite orangebox/garrysmod/lua/includes/modules/gm_sqlite_486.dll

Installing extra game content

See the Extra Content section of General Server Setup Information.

Optionally Creating a Startup Script

You can now in theory just run the server with this command: orangebox/srcds_run -console -game garrysmod +maxplayers 16 +map gm_construct -autoupdate

However if you close SSH your server will close too.

We want to attach our GMod server to a virtual screen so we can log off and come back later or share the screen with other users (Other admins for example).

Open up a file called startgmod.sh with your favourite editor, for example:

nano -w startgmod.sh

Enter the following into the file:

#!/bin/bash
echo "Starting up Garry's Mod 10 server."
sleep 5
screen -A -m -d -S gm10server orangebox/srcds_run -console -game garrysmod +maxplayers 16 +map gm_construct -autoupdate
echo "Started. Type screen -x to resume!"

You may wish to edit maxplayers and map.

Once you've got to this stage you're good to go. Make the script executable before running it:

chmod +x startgmod.sh

Everyday Server Operations

Starting Up

Type:

./startgmod.sh

Shutting Down

Type:

screen -x

This resumes your screen session, sharing it with any other users. If the server is still active with players, it's advisable to shut it down by typing:

killserver

Once you've done that, press Ctrl+C+X to kill the screen.

If it's hung, just press Ctrl+C+X.

Administration

If you type:

screen -x

You're sitting at the console of your server.

Info 64.png To disconnect from screen, type Ctrl+D+A.
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox