For direct access use https://forums.oldunreal.com
It's been quite a while since oldunreal had an overhaul, but we are moving to another server which require some updates and changes. The biggest change is the migration of our old reliable YaBB forum to phpBB. This system expects you to login with your username and old password known from YaBB.
If you experience any problems there is also the usual "password forgotten" function. Don't forget to clear your browser cache!
If you have any further concerns feel free to contact me: Smirftsch@oldunreal.com

Start / Stop for native server on Remote host

for Unreal & UnrealTournament
Post Reply
User avatar
Pitbull
Administrator
Posts: 1226
Joined: Fri Oct 04, 2002 6:47 pm
Location: Between Venus and Mars

Start / Stop for native server on Remote host

Post by Pitbull »

A friend is trying set up a server on a debian machine and everything is fine except a working start / stop feature. The machine currently runs 2 UT2K4 servers and an init file is used for starting / stopping those. Anyone have a clue how we can implement this? Below is the init for start / stopping the UT2K4 servers. if this can be modified for unreal the host can do the rest for the web console.

Code: Select all

BASEDIR=/home/carnage/tam/System 
COMMAND="ucc-bin server DM-Mojo-]i[?BlueTeamSymbol=TeamSymbols_tcplogo.team_blue?RedTeamSymbol=TeamSymbols_tcplogo.team_red?game=cuddles.Cuddle_Freon?GameStats=True?mutator=CtryTags.CtryTags,AntiTCC119Beta26.MutAntiTCCFinal,UTANBanManager103.MutUTAN  -nohomedir ini=Default.ini" 
LOGFILE=$BASEDIR/logs/uccDM.log  
UCCINITPIDFILE=$BASEDIR/ucc.init.pid  
UCCPIDFILE=$BASEDIR/ucc.pid  
 
case "$1" in  
start)  
echo starting ucc.init and ucc  
$0 fork &  
echo $! > $UCCINITPIDFILE  
disown  
;;  
stop)  
if test -f $UCCINITPIDFILE ; then  
if ps -p `cat $UCCINITPIDFILE` | grep ucc.init 1> /dev/null 2> /dev/null ; then  
echo killing ucc.init  
kill -TERM `cat $UCCINITPIDFILE` 1> /dev/null 2> /dev/null  
sleep 2  
kill -9 `cat $UCCINITPIDFILE` 1> /dev/null 2> /dev/null  
fi  
rm $UCCINITPIDFILE  
fi  
if test -f $UCCPIDFILE ; then  
if ps -p `cat $UCCPIDFILE` | grep ucc 1> /dev/null 2> /dev/null ; then  
echo killing ucc  
kill -TERM `cat $UCCPIDFILE` 1> /dev/null 2> /dev/null  
sleep 2  
kill -9 `cat $UCCPIDFILE` 1> /dev/null 2> /dev/null  
fi  
rm $UCCPIDFILE  
fi  
;;  
restart)  
$0 stop  
$0 start  
;;  
check)  
if test -f $UCCINITPIDFILE ; then  
if ! ps -p `cat $UCCINITPIDFILE` | grep ucc.init 1> /dev/null 2> /dev/null ; then  
if test -f $UCCPIDFILE ; then  
if ps -p `cat $UCCPIDFILE` | grep ucc 1> /dev/null 2> /dev/null ; then  
kill -TERM `cat $UCCPIDFILE` 1> /dev/null 2> /dev/null  
sleep 2  
kill -9 `cat $UCCPIDFILE` 1> /dev/null 2> /dev/null  
fi  
rm $UCCPIDFILE  
fi  
rm $UCCINITPIDFILE  
$0 start > /dev/null  
fi  
else  
if test -f $UCCPIDFILE ; then  
if ps -p `cat $UCCPIDFILE` | grep ucc 1> /dev/null 2> /dev/null ; then  
kill -TERM `cat $UCCPIDFILE` 1> /dev/null 2> /dev/null  
sleep 2  
kill -9 `cat $UCCPIDFILE` 1> /dev/null 2> /dev/null  
fi  
rm $UCCPIDFILE  
fi  
$0 start > /dev/null  
fi  
;;  
fork)  
while [ true ] ; do  
if test -f $LOGFILE ; then  
mv $LOGFILE $LOGFILE.old  
fi  
$BASEDIR/$COMMAND -log > $LOGFILE &  
echo $! > $UCCPIDFILE  
wait  
done  
;;  
*)  
echo "Usage: $0 {start|stop|restart|check}"  
;;  
esac
Upon this rock I will build my church O:-)

LOADING HATERS..████████████] 99% Complete.
User avatar
Pitbull
Administrator
Posts: 1226
Joined: Fri Oct 04, 2002 6:47 pm
Location: Between Venus and Mars

Re: Start / Stop for native server on Remote host

Post by Pitbull »

Anyone?
Upon this rock I will build my church O:-)

LOADING HATERS..████████████] 99% Complete.
User avatar
TCPCarnage
Posts: 4
Joined: Tue Jan 13, 2009 12:47 pm

Re: Start / Stop for native server on Remote host

Post by TCPCarnage »

My clanm8 aLICe made a script for it and i will be testing it this week

For the ones interested

Code: Select all

#!/bin/bash

# change as you need

BASEDIR="/home/carnage/unreal/System"
COMMAND="ucclinux server DMdowntown?Game=UTeamFix.TeamGameFix INI=Unreal.ini -silent port=8218 "

#don't change below

LOGDIR="$BASEDIR/logs"
FORKPID="$BASEDIR/logs/fork.pid"
FORKCOMMAND="$0"
FORKDIR="${FORKCOMMAND%/*}"
FORKCOMMAND="${FORKCOMMAND##*/}"
COMMANDPID="$BASEDIR/logs/${COMMAND%% *}.pid"

case "$1" in

start)      [ -d "$LOGDIR" ] || mkdir "$LOGDIR"
      if [ -f "$FORKPID" ]; then
            ps -fp "$(
Last edited by TCPCarnage on Sat Jan 24, 2009 8:27 pm, edited 1 time in total.
User avatar
Pitbull
Administrator
Posts: 1226
Joined: Fri Oct 04, 2002 6:47 pm
Location: Between Venus and Mars

Re: Start / Stop for native server on Remote host

Post by Pitbull »

Ah good Carnage, I'm glad you found something now. It would be nice if this could be incorporated with webadmin also.
Upon this rock I will build my church O:-)

LOADING HATERS..████████████] 99% Complete.
User avatar
TCPCarnage
Posts: 4
Joined: Tue Jan 13, 2009 12:47 pm

Re: Start / Stop for native server on Remote host

Post by TCPCarnage »

Well the problem there would be that the webadmin is not running when the server is not running.
User avatar
TCP_Wolf
Administrator
Posts: 1078
Joined: Sun Mar 03, 2002 12:04 pm
Contact:

Re: Start / Stop for native server on Remote host

Post by TCP_Wolf »

I may have an alternative for that, if you can run a Java Servlet capable server (Apache Tomcat, JBOSS, Sun One...) on the machine in question. Contact me over ICQ or something in case you're interested....
-=]HONESTY PAYS[=-
User avatar
+SanguineRose+
OldUnreal Member
Posts: 55
Joined: Wed Apr 08, 2009 2:32 am

Re: Start / Stop for native server on Remote host

Post by +SanguineRose+ »

Code: Select all

#/usr/bin/perl

USE CGI;

sub runucclinux;

$ucclinux = "/path/to/ucclinux";
$arguments = "MapListCrap";

print "Content Type: text/plain\n\n";

runucclinux;

sub runucclinux
{
      open(RUN, "$ucclinux $arguments|") || die "CRAP!\n";

      while ($out=)
      {
            print $out;
      }
      close(RUN);
}
Maybe? :D
Last edited by +SanguineRose+ on Tue Jun 09, 2009 10:37 pm, edited 1 time in total.
~Security is but an illusion of the mind~
Post Reply

Return to “Linux-Board”