The Unreal Admins Page - Forums

The Unreal Admins Page - Forums (
-   UT3 Server - Linux Specific (
-   -   UT3 Start/stop script (

skully 19th December, 2007 03:00 PM

UT3 Start/stop script
Hey all,

dont know if anyone used the 2k4 version but here is my script adjusted for UT3 linux dedicated servers.

Direct links You can use wget to get them directly to your box
- Script
Command: wget

- Install/Help
Command: wget

- Script+install/help
Command: wget
Unpack: tar -xzf ut3ss.tar.gz

What it can do
Commandline options
- start, this starts the server in background. All server output goes into logfile
- stop, this stops the running server
- restart, this restarts the running server
- check, this checks if the server is running and gives online or offline back
- status, this checks if the server is running and if not restart the server
- debug, this starts the server but wont background the process. All server output
will be showed on screen. To stop hit CTRL+C (this kills the running server!).

Note: There was a line in the INSTALL file that said that it was not possible to run 2 servers from 1 dir.. That is a lie. Just make sure you use different logfiles and pids for each instance

Have fun and if there are comments they can be places here. There is also an irc channel and forum listed in the script for support.

- Double spaces in gameopt makes in impossible to stop the server [fixed]

Download files are updated version 0.4.1

For people that dont want to redownload the files here is the fix IF you had problems with multiple spaces.

After this line:

Add this line:
gameopt=`echo ${gameopt}| sed s/"[ ]\{2,\}"/" "/g`

This will remove all extra spaces in the gameopt.


optarix12 19th December, 2007 04:15 PM

Brilliant! :D


skully 19th December, 2007 04:26 PM


i live on these replies ;)

You got it working then i asume?


LODEEP 19th December, 2007 06:17 PM


i was looking for 1... THUMBS UP


Starting goes fine, stopping doesn't

Stopping Clan UT3 dedicated server: server not running or crashed.


gamename="Clan UT3"
gameopt="server DM-Deck?MinPlayblablablabla

skully 20th December, 2007 11:53 AM

Hey Lodeep,

do you got awk installed?

You can use this command to check it. No result is not installed
dpkg -l |grep awk

If its not installed
apt-get install mawk

Other reason that might be the problem is that you changed the startup line (gameopt) once it was running. So, you start it.. Change the options, and then try to stop it. The checks in the script sees it as a different server and wont stop it because its not there. Because the server is started by the ut3 bin its hard to get a descent pid of the actual start of ut3-bin without modifying the ut3 file. By using the pid only its possible to start multiple servers with the same settings if you or someone delete the pid file. Thats not a good idea so thats why i use this method.

If you want to edit the line stop the server first, then edit and then start it again.

Kremlin 20th December, 2007 02:24 PM


Originally Posted by LODEEP (Post 135986)

Starting goes fine, stopping doesn't

Stopping Clan UT3 dedicated server: server not running or crashed.


gameopt="server DM-Deck?MinPlayblablablabla

Got the same prob here.

Anyways, good job :thumbup: many thanks :D

LODEEP 20th December, 2007 03:10 PM

dpkg -l |grep awk
ii mawk 1.3.3-11 a pattern scanning and text processing langu

and i didn't change the line's when server was running

everyone 20th December, 2007 05:36 PM

Running OpenSuSE 10.1....

Script is very well !!! :thumbup:

Art_illery 20th December, 2007 06:51 PM

Try implementing this method i use in my Server Startscripts. This way, you should be able to get the right pid at anytime, no matter if the PID changed due to some restarting of the Server or anything like that:

check() {
        # Ueberprueft den Server
        # 0 = Server ist offline
        # 1 = Server ist online
        # 2 = Server befindet sich gerade in einer Update Prozedur (Muss noch eingebaut werden in die check()-Funktion

        # Ermitteln der PIDs des Scripts und der Serverbinary mittels pgrep
                pgrep -f -u ${CSS_UNIXUSER} srcds_[^r].*port.${CSS_NETPORT} > ${CSS_SERVERPIDFILE}
                pgrep -f -u ${CSS_UNIXUSER} srcds_run.*port.${CSS_NETPORT} > ${CSS_PIDFILE}

        # Prüfen ob pgrep valide Daten in die .pid dateien geschrieben hat
      serverpid=`cat ${CSS_SERVERPIDFILE}`
                scriptpid=`cat ${CSS_PIDFILE}`
      if [ -n "${scriptpid}" -o "${serverpid}" ]
                        rm $CSS_PIDFILE
                        rm $CSS_SERVERPIDFILE

This is only the check() - Function of a CS-Source Serverscript i wrote, and the comments are in German, sorry for that, but if you have some bash scripting experience you should be able to figure out the way this is working.

Basically what i am doing is getting the full command line of the process, then look at the ports that are used in the commandline and distinguish the different Serverprocesses by the ports they are running on. This would mean, you would always have to put the Port-option into your commandline. But that isn´t really a big issue i think ;o)
Let me know what you think, and if you can use it to some extend. If not, no problem, I just thought i might give you a little alternative way of querying the running Serverprocesses ;o)

skully 20th December, 2007 07:00 PM

Hey Art_illery,

thx for your reply i will look into this. And yeah is easy to understand and i know some german so it will be ok :)

For the ones having problems,

can you send the ut3ss file to me thru mail ( info at ) with a problem description. I will test it and fix it when needed. Remove gamespy id/pass.

Make sure you use a proper editor like VIM or Notepad++ under windows if you are editing it. Dos editors like Wordpad can make the file corrupt.

skully 20th December, 2007 07:16 PM

Just had a file and this one had 2 spaces in the gameopt between 2 options. Removing one space solved the problem that it cant be stopped.

I will fix something that removes all extra spaces.

skully 20th December, 2007 07:49 PM

Issue fixed. Check 1st post for the fix

[K*T]R!GGeD 5th February, 2008 03:47 PM

i would like to try your script but i get this when i try to d/l:

Connecting to||:80... connected.
HTTP request sent, awaiting response... 403 Forbidden
09:39:20 ERROR 403: Forbidden.

is this intentional?

skully 5th February, 2008 03:51 PM


edited some files a bit too hard. Fixed now

Asmodan 23rd February, 2008 11:53 AM

It's working fine for me - 2.6.23-gentoo-r8


Stalker729 23rd February, 2009 12:18 PM

Ty m8 - will try it. ;) CentOS 5.2

All times are GMT +1. The time now is 01:34 PM.


All pages are copyright The Unreal Admins Page.
You may not copy any pages without our express permission.