insserver: Insurgency Linux Server Manager

Insurgency Logo
linux game server manager

About insserver

insserver is a command line tool for quick, simple deployment and management of a Insurgency Linux dedicated server.

Current Version: 100914

Main Features

  • Server installer (SteamCMD).
  • Start/Stop/Restart server.
  • Server update (SteamCMD).
  • Server monitor (including email notification).
  • Server backup.
  • Server console.

Compatibility

The Linux Game Server Manager is tested to work on the following Linux systems.

  • Debian based distros (Ubuntu, Mint etc.).
  • Redhat based distros (CentOS, Fedora etc.).

Compatibility results can be found here.

The scripts are written in BASH and Python, so would likely work with other distros.

Installation

The installer will automatically download and configure a Insurgency server.

Prerequisites

Before installing, please ensure you have all the dependencies required to run the script.

Ubuntu

Ubuntu 32-bit

apt-get install gdb mailutils postfix

Ubuntu 64-bit

apt-get install gdb mailutils postfix lib32gcc1

Debian

Debian 32-bit

apt-get install gdb mailutils postfix tmux ca-certificates

Debian 64-bit

dpkg --add-architecture i386
apt-get update
apt-get install gdb mailutils postfix tmux ca-certificates lib32gcc1

RHEL 6/CentOS 6

Note: EPEL repository or equivalent is required.
http://fedoraproject.org/wiki/EPEL

RHEL 6/CentOS 6 32-bit

yum install gdb mailx wget nano tmux

RHEL 6/CentOS 6 64-bit

yum install gdb mailx wget nano tmux glibc.i686 libstdc++.i686

Install

1. Create a user and login.

adduser insserver
passwd insserver
su - insserver

2. Download the script.

wget http://danielgibbs.co.uk/dl/insserver

3. Make it executable.

chmod +x insserver

4. Add Steam login details

You will need to enter your steam username and password to allow authentication to the steamCMD system. I recommend that you create a new Steam username just for the server.

nano insserver
# Steam login
steamuser="username"
steampass="password"

5. Run the installer and follow the instructions.

./insserver install

Usage

Running the Server

Start the server.

./insserver start

Stop the server.

./insserver stop

Restart the server.

./insserver restart

Updating the Server

The server can be updated automatically using SteamCMD. The update option will stop the server, run the SteamCMD update and start the server again.

./insserver update

To restart the server while updating use update-restart.
It is recommended that you restart the server when an update is completed to apply the update.

./insserver update-restart

Server Validate

It is possible to use the validate option when updating the server.

Validate is a command that will check all the server files to make sure they match the SteamCMD files.
This command is useful if you think files may be missing or corrupted.
Note: Validation will overwrite any files that have been changed. This may cause issues with customized servers. For example if you customize mapcycle.txt this file will be overwritten to the server default. Any files that are not part of the default installation will not be affected.

./insserver validate

To restart the server while validating use validate-restart.

./insserver validate-restart

Running on Boot

To run insserver on boot add the command in to the rc.local file.

nano /etc/rc.local
su - insserver -c '/home/insserver/insserver start'

Monitoring the Server

The script can monitor the server to ensure it is online. Should the server go offline, the monitor will attempt to start it again.

./insserver monitor

Note: see Automation on how to get monitor to run automatically.

Game Server Query Plugin

The Game Server Query plugin adds improved monitoring over the standard monitoring feature.

gsquery.py queries the server to see if it responds with its server details. If it fails to respond the server will be restarted.

This is particularly useful if a server has locked up or frozen but the server instance/process is still running.

Install Game Server Query Plugin

Download gsquery.py to the same directory as the main script.

wget http://danielgibbs.co.uk/dl/gsquery.py

Make it executable

chmod +x gsquery.py

To test is works run monitor and it will state that gsquery.py was detected.

Email Notification

Monitoring can send you an email, should the server go offline, and report details of the issue. See example email below.
linuxserverscript email notification

Enable email notification

nano insserver
# Notification Email
# (on|off)
emailnotification="on"
email="[email protected]"

Test email notification

You can test email notifications are working without restarting the server.

./insserver email-test

Debug Mode

Use debug mode to help you if you are having issues with the server. Debug allows you to see the output of the server directly to your terminal allowing you to diagnose any problems the server might be having.

./insserver debug

Server Details

If you need to get all main server details you can use the following command.
You will be given the following details if applicable to your server:

  • Server Name
  • Server Ports
  • Rcon Password
  • Config File
  • WebAdmin Username
  • WebAdmin Password

This can be very useful if you have forgotten your servers details.

./insserver details

Console Mode

Console allows you to view the live console of a server as it is running and allow you to enter commands to it.

./insserver console

To exit the console press “CTRL+b d”.
Note: pressing “CTRL+c” will terminate the server.

Backup

Backup will allow you to create a complete gzip archive of the whole server.

This is designed to allow you to backup before making changes to the server just in case there is a problem.

Note: this is not designed to be an automated backup solution.

./insserver backup

Automation

You can use cronjobs to automate the process of updating and monitoring the server. You can either run the cronjob as root or as the insserver user.

Server Update

Update the server at 5am daily.

Root Cronjob

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

insserver Cronjob

crontab -e
0 5 * * * /home/insserver/insserver update-restart > /dev/null 2>&1

Server Monitor

Check the server is online every 5 mins.

Root Cronjob

crontab -e
*/5 * * * * su - insserver -c '/home/insserver/insserver monitor' > /dev/null 2>&1

insserver Cronjob

crontab -e
*/5 * * * * /home/insserver/insserver monitor > /dev/null 2>&1

Configuration

note: I cannot provide specific help with configuration. See FAQ’s for more help, there are also various other websites that can provide assistance.

Start Parameters

If you need to adjust the start parameters you can edit the ‘parms’ variable under ‘Start Variables’ in the script.

parms="-strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}"

See this link for all available start parameters.
https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server

Config File

The server has a default config file that will allow you to edit many different settings.

To find the config file use the details command.

./insserver details

Default Ports

Gameport (Inbound): 27015 UDP
Source TV (Inbound): 27020 UDP
Client Port (Outbound): 27005 UDP

Should you need to change the port edit the start variables and amend the port to meet your requirements.

port="27015"
sourcetvport="27020"
clientport="27005"

Multiple Servers

It is possible to run multiple server instances. There are a couple of methods depending on ho you want to configure your server.

Separate Installation (Easy)

Repeat the installation process with a different username and change the ports within the script.

/home/insserver
/home/insserver2

Same Installation Different Config File (Advanced)

/home/insserver

./insserver

./insserver2

cfg

ins-server.cfg

ins-server2.cfg

Copy and rename the script for example .

cp insserver insserver2

Edit insserver2.

nano insserver2

Rename the servicename variable.

servicename="ins-server2"

Change the server ports.

port="27016"
sourcetvport="27021"
clientport="27006"

Copy and rename the server config file.

cp ins-server.cfg ins-server2.cfg

Alter the new configuration file to suite your needs.

Running as root

The script will not run as root and will error if you try. This is for security and to stop permissions issues. For example, if you run update as root any changed files are then owned by root. This means the insserver user will be unable to access the updated files causing the server to fail.

[ FAIL ] Script will not run as root!

Useful Resources

A complete list of useful resources can be found on the FAQ page.

Issues and Troubleshooting

Found a bug or have a suggestion? Please submit a bug report on GitHub .

https://github.com/dgibbs64/linuxgameservers/issues

If you are having problems you probably missed something in the instructions, ensure you have followed them accurately.

You can also check the FAQ page for common questions and problems.

Still stuck? Leave a comment.

GitHub

This script is developed using GitHub you can view the full project here:

https://github.com/dgibbs64/linuxgameservers

Further Notes

This script is free to use and you are welcome to customise and change it. I hope the script makes it easier to manage a Insurgency server.

Found my work helpful? Show your appreciation.
Please consider donating to help cover server costs/buy a beer.

PayPal: [email protected]

More info about supporting the project on my about page.

Thank you for your support.

Spread the Word

You can help by spreading the word by letting people know about this script.
Tell your friends, Tweet, Facebook, post on forums or write a blog post.

I am interested to know if you are using this script tweet me.

@dangibbsuk

  • http://www.insurgency.pl/ Mr. Jędяula

    Nice job m8 :) i will share with that on my community service.

    • http://danielgibbs.co.uk/ Daniel Gibbs

      Thank you :D

  • A-L-G

    will it run on the new centos 6.5 64 bit

    • http://danielgibbs.co.uk/ Daniel Gibbs

      I’m afraid not. Dependency issues again. Similar to ns2server and nmrihserver had. Except I have not been able to get this server working myself….yet

  • Guest

    Hey Daniel it’s me CyberCam (I donated to you), I have included a link to this site for my Steam Windows Server Tutorial if you don’t mind.

    http://steamcommunity.com/sharedfiles/filedetails/?id=221623461&tscn=1391156487#-1

    • CyberCam

      Wow I thought I deleted this one…. ignore it, it has the wrong link!

  • CyberCam

    Hey Daniel it’s me CyberCam (I donated to you), I have included a link to this site for my Steam Windows Server Tutorial if you don’t mind.
    http://steamcommunity.com/sharedfiles/filedetails/?id=221623461#

    • http://danielgibbs.co.uk/ Daniel Gibbs

      Great tutorial. Thanks for the link :D. I recommend checking out the Valve Wiki page I have started about Insurgancy dedi servers (Its incomplete currently) . Maybe you could put the tutorial up there. https://developer.valvesoftware.com/wiki/Insurgency_2014_Dedicated_Server. If I get chance I would like to post your tutorial on my blog (Linking back to the original) if that is OK with you.

      • CyberCam

        Fine by me! I will check out the Valve Wiki page! Thanks!

  • remondo

    Hi Daniel, me again (sorry)! After failing to run a dedicated server manually I once again came across your script. I’ve installed the server by following your guide on my Debian 7 Wheezy x64 VPS but when I come to start the server I get the following error:

    Failed to open dedicated.so (/lib/i386-linux-gnu/i686/cmov/libc.so.6: version `GLIBC_2.15′ not found (required by ./bin/dedicated.so))

    I had this same error when I tried to run the server after installing manually so I guess it’s something to do with my VPS. I’ve Googled it and tried all sorts of things like attempting to update GLIBC but nothing worked. Any ideas?

    I also tried running the server on windows server 2008 but nothing seemed to happen when I started the server.

    Should I try Ubuntu? Which version of ubuntu would you recommend for this?

    • http://danielgibbs.co.uk/ Daniel Gibbs

      Hey Remondo. Debian will work you are just missing the dependencies. You follow the prerequisites section of this tutorial. It just to happens that I will be setting up a live server for insurgency today and running more tests with Debian. If I find any issues I will be updating this script and instructions. Hop this helps

      • remondo

        I installed all the dependencies in the prerequisites and tried various suggestions on forums to update GLIBC but the error persists. From what I understood, GLIBC_2.15 is not compatible with certain distros but people reported success on ubuntu so I guess that’s the next logical step, I’m just fed up of installing OS’s and configuring everything only to find it doesn’t work!

        • http://danielgibbs.co.uk/ Daniel Gibbs

          I’m investigating this further I have previously fixed this by having the required files located in serverfiles. However this is not working currently. I think Ubuntu is the only way to go currently. Very frustrating.

          • remondo

            Did you not see my other reply above? I’ve had a server running on Debian 7 Wheezy x64 for a few days now. You need to copy the dependencies from ubuntu into the bin folder of the server. Once you do that everything works as expected.

          • http://danielgibbs.co.uk/ Daniel Gibbs

            I have updated insserver script and it now works with CentOS and Debian woooo!! :D

      • remondo

        I’ve managed to answer my own question again, here’s what you need to do if you encounter this error:

        Download this library from the ubuntu site:
        http://security.ubuntu.com/ubuntu/pool/main/e/eglibc/libc6_2.15-0ubuntu10.5_i386.deb

        Extract it to a /tmp folder:
        dpkg -x libc6_2.15-0ubuntu10.5_i386.deb tmp/

        Copy everything from the /tmp/lib/i386-linux-gnu folder to the /bin folder of the insurgency server installation. For me that was /home/insserver/serverfiles/bin

        Thanks to Sepp on the Steam forums for the solution. Source: http://steamcommunity.com/app/222880/discussions/2/558746089453980404/

        I tried this last night on my manual installation but must have done something wrong. Oh well, it’s working! Thanks again, Daniel.

  • mysticviperx

    Insurgency Debug
    ============================

    Use for identifying server issues only!
    Press CTRL+c to drop out of debug mode
    WARNING! If ins-server is already running it will be stopped

    Start parameters:
    -strictportbind -ip 66.187.65.134 -port 27015 +clientport 27005 +tv_port 27020 +map ministry +servercfgfile ins-server.cfg -maxplayers 16

    Continue? [y/N]y
    [ …. ] Stopping ins-server: The Compound by Parallax Gaming (www.parallaxgamin
    [ FAIL ] Stopping ins-server: The Compound by Parallax Gaming (www.parallaxgaming.com) is already stopped
    [ …. ] Starting debug mode ins-server: The Compound by Parallax Gaming (www.pa
    [ OK ] Starting debug mode ins-server: The Compound by Parallax Gaming (www.parallaxgaming.com)
    ./insserver: line 222: ./srcds_run: No such file or directory

    • http://danielgibbs.co.uk/ Daniel Gibbs

      Ouphs forgot to change that back. shoudl be ./srcds_linux change this on the executable variable and this woll work. I will resolve this soon

      • mysticviperx

        sorry where?

        • mysticviperx

          line 48:

          executable=”./srcds_run”

          change to?

          executable=”./srcds_linux”

        • http://danielgibbs.co.uk/ Daniel Gibbs

          Thanks for spotting this. I have not fixed the issue. Let me know if you have any more issues :)

  • iBot

    Could you please move back to screen? Tmux is annoying and not user friendly since the console lags and is definitely not the way to manage the server.

  • Kurogane

    I’m having a problem to install INS2, when i’m the part steam login give me this error

    Installing Insurgency Server
    =================================
    Redirecting stderr to ‘/home/insserver/Steam/logs/stderr.txt’
    [ 0%] Checking for available updates…
    [—-] Verifying installation…
    Steam Console Client (c) Valve Corporation
    — type ‘quit’ to exit —
    Loading Steam3…OK.
    Logging in user ‘myuser’ to Steam Public…Login Failure: No Connection
    Failed.
    ERROR! Failed to request AppInfo update, not online or not logged in to Steam.

    I put the correct credentials and i not have firewall installed.

    What can be the problem.

    Thanks

  • Franky

    This script did not work on my ubuntu 14.04(x86 and x64) LTS.
    Delete these files (libc.so.6, libpthread.so.0 and librt.so.1) and validate server files then work fine.

    Sorry for my poor english.

    • Newtsy

      I’m not 100% sure what this did, but it worked for me, also on Ubuntu 14.04 x86. Was getting a segfault previously.

    • Emil

      I have the same error when starting the server:
      ./insserver: line 191: 1011 Segmentation fault (core dumped) ${executable} ${parms} -debug

      Where are these files located, I’ve tried to find them but no luck. Tried removing and reinstalling insserver, tried update and validate with no luck. Running on Ubuntu 14.04 x64). Any help is appreciated as this is the only server I can’t get working.

      • http://danielgibbs.co.uk/ Daniel Gibbs

        Hello

        If this is still a problem please raise it as an issue on the github page and I will take a look when possible.

        https://github.com/dgibbs64/linuxgameservers/issues

      • CyberCam

        The files are located in /home/insserver/serverfiles/bin/

  • ConnallTheCoble

    I keep getting some sort of segmentation error when trying to start the server.

  • https://plus.google.com/114808276807720276999 Trent Ditto

    Daniel, first I think this ;looks excellent but I cant make is work. Getting “[ FAIL ] Starting ins-server: Failed to start” after script finishes.

    However during install I got “OK” at every step.

    Any help you could offer would be great.

    • http://danielgibbs.co.uk Daniel Gibbs

      Try debug mode to see what error is coming up. Also run validate

  • Kasper R-T

    The git link doesn’t work anymore..?

  • E. Tasche

    I had to download this from github as a zip of all of the servers (https://github.com/dgibbs64/linuxgameservers), as the wget address did not work.
    This does work on Arch linux (tested on a few distros just to see where it works), as long as you install Tmux (“sudo pacman -S tmux”).
    Incredibly well done. Makes getting up and running easy.

  • BackIsBachus

    Hi, I just tried to run a dedicated server for LAN games (on my debian server) by following your tutorial but I can’t seem to get the server working (even with a default config).

    When I launch it and try to start the server and launch th monitor command I get this error : “[ FAIL ] Monitoring ins-server: Querying port: my_server_local_ip:27015: ERROR: Unable to receive”

    When I go to debug the console gives me those errors :

    “[S_API FAIL] SteamAPI_Init() failed; SteamAPI_IsSteamRunning() failed.
    [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so.
    […]
    Could not establish connection to Steam servers.”

    I tried maps in coop to see if at least bot joined (ans they do), when I try connect to the server in the Server Browser, the server with its properties is in the list but when I try to connect the server info displays and says “Server not responding”.

    I also added iptables rules for the port 27015 to make sure it is open.

    Does it look like a configuration problem (in which case it I’ll try do find the problem by myself) or something more related to your tutorial (in which case I hope you can help).

    Thanks !

  • http://www.dickiesstore.co.uk/ DarkMukke

    What are the minimum system requirements to run this server on linux ?
    I got a dual quad core (8 cores) but only a clockspeed of 2.4 Ghz and 32GB of ram. Would that be enough ?

    • http://www.dickiesstore.co.uk/ DarkMukke

      Nvm, its a HL2 server so dual core 2.4Gz with 4GB of ram will do

  • RetroStatic

    This. Because Insurgency.

    :D

    Worked perfectly on Ubuntu 14.04.

  • http://www.camjgaming.com CamJ

    I am using this on a VPS openvz with 6gb ram and it seems to crash everyday, as I get an email from the monitor saying that it has restarted. Anyone else get the same problem?