You are an unregistered user, you can register here
Navigation

Information

Site

Donations
If you wish to make a donation you can by clicking the image below.


 
Go Back   The Unreal Admins Page > Forums > Unreal Admins > Unreal Tournament 3 > UT3 Server - Linux Specific

Reply
Thread Tools Display Modes
  #1  
Unread 19th December, 2007, 03:00 PM
skully skully is offline
Killing Spree
 
Join Date: Jun 2006
Location: Netherlands
Posts: 33
Default 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 http://aria.dominating.nl/ut-admin/ut3/ut3ss

- Install/Help
Command: wget http://aria.dominating.nl/ut-admin/ut3/INSTALL

Package
- Script+install/help
Command: wget http://aria.dominating.nl/ut-admin/ut3/ut3ss.tar.gz
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.

Issues:
- 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:
realbin="./ut3-bin"

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

This will remove all extra spaces in the gameopt.

Regards.

Last edited by skully : 20th December, 2007 at 07:55 PM. Reason: issues fixed
Reply With Quote
  #2  
Unread 19th December, 2007, 04:15 PM
optarix12 optarix12 is offline
Forum Newcomer
 
Join Date: Dec 2007
Posts: 7
Default

Brilliant!

---Mike
Reply With Quote
  #3  
Unread 19th December, 2007, 04:26 PM
skully skully is offline
Killing Spree
 
Join Date: Jun 2006
Location: Netherlands
Posts: 33
Default

Thanks,

i live on these replies

You got it working then i asume?

Regards
Reply With Quote
  #4  
Unread 19th December, 2007, 06:17 PM
LODEEP's Avatar
LODEEP LODEEP is offline
Rampage
 
Join Date: Aug 2002
Location: Netherlands
Posts: 71
Default

BIG THXZ

i was looking for 1... THUMBS UP

edit:

Starting goes fine, stopping doesn't

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

(debian)

basedir="/home/serverut3/ut3-dedicated"
gamename="Clan UT3"
gamebin="Binaries/ut3"
gamepid="${basedir}/ut3.pid"
gamelog="${basedir}/ut3.log"
gameopt="server DM-Deck?MinPlayblablablabla

Last edited by LODEEP : 19th December, 2007 at 08:22 PM.
Reply With Quote
  #5  
Unread 20th December, 2007, 11:53 AM
skully skully is offline
Killing Spree
 
Join Date: Jun 2006
Location: Netherlands
Posts: 33
Default

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.

Last edited by skully : 20th December, 2007 at 12:28 PM. Reason: Extra help
Reply With Quote
  #6  
Unread 20th December, 2007, 02:24 PM
Kremlin Kremlin is offline
Forum Newcomer
 
Join Date: Nov 2006
Location: Netherlands
Posts: 5
Default

Quote:
Originally Posted by LODEEP View Post
BIG THXZ

Starting goes fine, stopping doesn't

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

(debian)

gameopt="server DM-Deck?MinPlayblablablabla

Got the same prob here.

Anyways, good job many thanks
Reply With Quote
  #7  
Unread 20th December, 2007, 03:10 PM
LODEEP's Avatar
LODEEP LODEEP is offline
Rampage
 
Join Date: Aug 2002
Location: Netherlands
Posts: 71
Default

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
Reply With Quote
  #8  
Unread 20th December, 2007, 05:36 PM
everyone's Avatar
everyone everyone is offline
Forum Newcomer
 
Join Date: Aug 2005
Location: germany
Posts: 14
Default ^^

Running OpenSuSE 10.1....

Script is very well !!!
Reply With Quote
  #9  
Unread 20th December, 2007, 06:51 PM
Art_illery Art_illery is offline
Killing Spree
 
Join Date: Oct 2007
Posts: 24
Default

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:
Code:
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}" ]
      then
                        status=1
      else
                        status=0
                        rm $CSS_PIDFILE
                        rm $CSS_SERVERPIDFILE
      fi
}
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)

Last edited by Art_illery : 20th December, 2007 at 07:08 PM.
Reply With Quote
  #10  
Unread 20th December, 2007, 07:00 PM
skully skully is offline
Killing Spree
 
Join Date: Jun 2006
Location: Netherlands
Posts: 33
Default

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 dominating.nl ) 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.
Reply With Quote
  #11  
Unread 20th December, 2007, 07:16 PM
skully skully is offline
Killing Spree
 
Join Date: Jun 2006
Location: Netherlands
Posts: 33
Default

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.

Last edited by skully : 20th December, 2007 at 07:20 PM.
Reply With Quote
  #12  
Unread 20th December, 2007, 07:49 PM
skully skully is offline
Killing Spree
 
Join Date: Jun 2006
Location: Netherlands
Posts: 33
Default

Issue fixed. Check 1st post for the fix
Reply With Quote
  #13  
Unread 5th February, 2008, 03:47 PM
[K*T]R!GGeD [K*T]R!GGeD is offline
Forum Newcomer
 
Join Date: Apr 2005
Posts: 6
Default

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

--09:39:17-- http://aria.dominating.nl/ut-admin/ut3/INSTALL
Resolving aria.dominating.nl... 213.207.100.54
Connecting to aria.dominating.nl|213.207.100.54|:80... connected.
HTTP request sent, awaiting response... 403 Forbidden
09:39:20 ERROR 403: Forbidden.


is this intentional?
Reply With Quote
  #14  
Unread 5th February, 2008, 03:51 PM
skully skully is offline
Killing Spree
 
Join Date: Jun 2006
Location: Netherlands
Posts: 33
Default

Sorry,

edited some files a bit too hard. Fixed now
Reply With Quote
  #15  
Unread 23rd February, 2008, 11:53 AM
Asmodan's Avatar
Asmodan Asmodan is offline
Forum Newcomer
 
Join Date: Dec 2005
Location: Germany, nearby Cologne
Posts: 5
Default

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

:-)
__________________
irc - some ut chan:

[17:28:36] <aaaaaaaaaaaaaaaaa> i dont need a fucking aimbot
[17:28:55] <Neophyte> what about one thats sexually sterile?
Reply With Quote
  #16  
Unread 23rd February, 2009, 12:18 PM
Stalker729 Stalker729 is offline
Forum Newcomer
 
Join Date: Oct 2003
Location: Moscow, Russia
Posts: 8
Default

Ty m8 - will try it. CentOS 5.2
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:46 AM.


 

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