PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : UT2k4 Server tod nach Shell schliessung


AgentRoCkZ
17.04.06, 07:47
Hallo folkz...

da ich neu hier bin,

erstmal dankeschön für alle die sich hier die mühe machen.

ich habe folgendes problem:

Ich starte meinen UT2k4 Server (Suse 9.2), und sobald ich die Shell (putty) schliesse ist er offline.

hab schon alles durchprobiert:

./ucc-bin server DM-Rankin?game=XGame.xTeamGame ini=UT2004.ini log=ServerCrashlog.log --nohomedir &

nohup ./ucc-bin server DM-Rankin?game=XGame.xTeamGame ini=UT2004.ini log=ServerCrashlog.log --nohomedir &

screen ./ucc-bin server DM-Rankin?game=XGame.xTeamGame ini=UT2004.ini log=ServerCrashlog.log --nohomedir &

nix hilft :( ich bin echt am verzweifeln :(

wenn ich mit screen starte terminiert er sich schon beim starten des servers, funkt also garnicht.

Hatte das Problem noch nie bei anderen Games, nur UT2k4...

währe nett wenn jemand rat wüsste...

vielen dank

so long

Matze..

drfish
17.04.06, 09:01
Das könnte Dir vielleicht helfen:
http://www.utzone.de/include.php?path=content/articles.php&contentid=1839

AgentRoCkZ
17.04.06, 09:14
Danke aber es hilft ned weiter,

auf Unrealadmin.org hab ich folgendes gefunden:

Lastly, if you are starting your server via putty then you may wish to run your server in the background so that it stays running once you exit putty. This is simple to do by adding & to the end of your command line. For example:

ucc-bin server CTF-BridgeOfFate?game=XGame.xCTFGame ini=ut2004.ini -nohomedir &

aber wie gesagt geht ned

ich weiss echt ned weiter :(

-hanky-
17.04.06, 09:59
Moin,

wie beendest du Putty?

Per 'exit' oder indem du einfach auf das X klickst?

-hanky-

therealmisterx
17.04.06, 10:46
im notfall hilft dir "screen" weiter.

Fisch.666
17.04.06, 11:06
wenn ich mit screen starte terminiert er sich schon beim starten des servers, funkt also garnicht.


man screen

oder die Suchfunktion hilft dir sicher weiter. Der Syntax deines screen Befehls oben ist total falsch...

jeppo
17.04.06, 12:46
hier das script von ut99 das ich für ut2004 angepasst habe variablen ändern fertig
funktioniert ohne nohup bzw. screen
#!/bin/sh
#
# standard format startup script for unreal tournament
#
# (c) 1999-2002 abfackeln@abfackeln.com
# last modified 2002-04-24
################################################## ####
#
# modified 2005-04-01
# work now with UT and UT2004
################################################## ####

MYNAME=ut2004_server01

# MYGAME Unreal Tournament UT2004
# BotPack.Assaul Engine.GameInfo
# BotPack.CTFGame BonusPack.xLastManStandingGame
# BotPack.DeathMatchPlus BonusPack.xMutantGame
# BotPack.Domination Onslaught.ONSOnslaughtGame
# BotPack.LastManStanding SkaarjPack.Invasion
# BotPack.TeamGamePlus UnrealGame.DeathMatch
# UnrealGame.TeamGame
# UnrealGame.UnrealMPGameInfo
# UT2K4Assault.ASGameInfo
# XGame.xBombingRun
# XGame.xDeathMatch
# XGame.xCTFGame
# XGame.xDoubleDom
# XGame.xTeamGame
MYGAME=XGame.xTeamGame

# MYMAP Unreal Tournament UT2004
# AS-Frigate.unr AS-Convoy.ut2
# AS-Guardia.unr AS-FallenCity.ut2
# AS-HiSpeed.unr AS-Glacier.ut2
# AS-Mazon.unr AS-Junkyard.ut2
# AS-OceanFloor.unr AS-MotherShip.ut2
# AS-Overlord.unr AS-RobotFactory.ut2
# AS-Rook.unr BR-Anubis.ut2
# CTF-Beatitude.unr BR-Bifrost.ut2
# CTF-Command.unr BR-BridgeOfFate.ut2
# CTF-Coret.unr BR-Canyon.ut2
# CTF-Cybrosis][.unr BR-Colossus.ut2
# CTF-Darji16.unr BR-DE-ElecFields.ut2
# CTF-Dreary.unr BR-Disclosure.ut2
# CTF-EpicBoy.unr BR-IceFields.ut2
# CTF-EternalCave.unr BR-Serenity.ut2
# CTF-Face-SE.unr BR-Skyline.ut2
# CTF-Face.unr BR-Slaughterhouse.ut2
# CTF-Gauntlet.unr BR-TwinTombs.ut2
# CTF-Hydro16.unr CTF-1on1-Joust.ut2
# CTF-LavaGiant.unr CTF-AbsoluteZero.ut2
# CTF-Niven.unr CTF-Avaris.ut2
# CTF-November.unr CTF-BridgeOfFate.ut2
# CTF-Noxion16.unr CTF-Chrome.ut2
# CTF-Ratchet.unr CTF-Citadel.ut2
# DM-1on1-Argessus.unr CTF-Colossus.ut2
# DM-1on1-DavidM2.unr CTF-December.ut2
# DM-1on1-DavidM.unr CTF-DE-ElecFields.ut2
# DM-1on1-DrPest.unr CTF-DoubleDammage.ut2
# DM-1on1-Revenge.unr CTF-Face3.ut2
# DM-1on1-Strogg.unr CTF-FaceClassic.ut2
# DM-1on1-Tonnberry.unr CTF-Geothermal.ut2
# DM-Agony.unr CTF-Grassyknoll.ut2
# DM-ArcaneTemple.unr CTF-Grendelkeep.ut2
# DM-Barricade.unr CTF-January.ut2
# DM-Bishop.unr CTF-Lostfaith.ut2
# DM-Closer.unr CTF-Magma.ut2
# DM-Codex.unr CTF-Maul.ut2
# DM-Constructor.unr CTF-MoonDragon.ut2
# DM-Conveyor.unr CTF-Orbital2.ut2
# DM-Curse][.unr CTF-Smote.ut2
# DM-Cybrosis][.unr CTF-TwinTombs.ut2
# DM-Deck16][.unr DM-1on1-Albatross.ut2
# DM-Fetid.unr DM-1on1-Crash.ut2
# DM-Fractal.unr DM-1on1-Desolation.ut2
# DM-Gothic.unr DM-1on1-Idoma.ut2
# DM-Grinder.unr DM-1on1-Irondust.ut2
# DM-Grit-TOURNEY.unr DM-1on1-Mixer.ut2
# DM-HealPod][.unr DM-1on1-Roughinery.ut2
# DM-HyperBlast.unr DM-1on1-Serpentine.ut2
# DM-KGalleon.unr DM-1on1-Spirit.ut2
# DM-Liandri.unr DM-1on1-Squader.ut2
# DM-Malevolence.unr DM-1on1-Trite.ut2
# DM-Mojo][.unr DM-Antalus.ut2
# DM-Monday.unr DM-Asbestos.ut2
# DM-Morbias][.unr DM-Compressed.ut2
# DM-Morpheus.unr DM-Corrugation.ut2
# DM-Oblivion.unr DM-Curse4.ut2
# DM-Peak.unr DM-Deck17.ut2
# DM-Phobos.unr DM-DE-Grendelkeep.ut2
# DM-Pressure.unr DM-DE-Ironic.ut2
# DM-Pyramid.unr DM-DE-Osiris2.ut2
# DM-Shrapnel][.unr DM-DesertIsle.ut2
# DM-Stalwart.unr DM-Flux2.ut2
# DM-StalwartXL.unr DM-Gael.ut2
# DM-Tempest.unr DM-Gestalt.ut2
# DM-Turbine.unr DM-Goliath.ut2
# DM-Viridian-TOURNEY.unr DM-HyperBlast2.ut2
# DM-Zeto.unr DM-Icetomb.ut2
# DOM-Bullet.unr DM-Inferno.ut2
# DOM-Cidom.unr DM-Injector.ut2
# DOM-Cinder.unr DM-Insidious.ut2
# DOM-Condemned.unr DM-IronDeity.ut2
# DOM-Cryptic.unr DM-Junkyard.ut2
# DOM-Gearbolt.unr DM-Leviathan.ut2
# DOM-Ghardhen.unr DM-Metallurgy.ut2
# DOM-Lament.unr DM-Morpheus3.ut2
# DOM-Lament][.unr DM-Oceanic.ut2
# DOM-Leadworks.unr DM-Phobos2.ut2
# DOM-MetalDream.unr DM-Plunge.ut2
# DOM-Olden.unr DM-Rankin.ut2
# DOM-Sesmar.unr DM-Rrajigar.ut2
# DOM-WolfsBay.unr DM-Rustatorium.ut2
# DM-Sulphur.ut2
# DM-TokaraForest.ut2
# DM-TrainingDay.ut2
# DOM-Access.ut2
# DOM-Aswan.ut2
# DOM-Atlantis.ut2
# DOM-Conduit.ut2
# DOM-Core.ut2
# DOM-Junkyard.ut2
# DOM-OutRigger.ut2
# DOM-Renascent.ut2
# DOM-Ruination.ut2
# DOM-ScorchedEarth.ut2
# DOM-SepukkuGorge.ut2
# DOM-Suntemple.ut2
# ONS-Adara.ut2
# ONS-ArcticStronghold.ut2
# ONS-Aridoom.ut2
# ONS-Ascendancy.ut2
# ONS-Crossfire.ut2
# ONS-Dawn.ut2
# ONS-Dria.ut2
# ONS-FrostBite.ut2
# ONS-IslandHop.ut2
# ONS-Primeval.ut2
# ONS-RedPlanet.ut2
# ONS-Severance.ut2
# ONS-Torlan.ut2
# ONS-Tricky.ut2
# ONS-Urban.ut2
MYMAP=DM-Deck17.ut2

# MYMODS Unreal Tournament UT2004
# BDBMapVote304.BDBMapVote Bonuspack.MutCrateCombo
# BotPack.ChainsawMelee Bonuspack.MutPintSizeCombo
# BotPack.FatBoy Onslaught.MutLightweightVehicles
# BotPack.FlakArena Onslaught.MutOnslaughtWeapons
# BotPack.InstaGibDM OnslaughtFull.MutVehicleArena
# BotPack.InstantRockets UnrealGame.DMMutator
# BotPack.JumpMatch UnrealGame.MutBigHead
# BotPack.LowGrav UnrealGame.MutDelayedSpawn
# BotPack.NoPowerups UnrealGame.MutGameSpeed
# BotPack.NoRedeemer UnrealGame.MutLowGrav
# BotPack.PulseArena UnrealGame.MutMovementModifier
# BotPack.RocketArena UTClassic.MutUTClassic
# BotPack.ShockArena UTClassic.MutUseSniper
# BotPack.SniperArena UTClassic.MutUseLightning
# BotPack.Stealth XGame.MutInstaGib
# ChapsNoFlak.ChapsNoFlak XGame.MutZoomInstaGib
# CB12.CB_Mutator XWeapons.MutArena
# CB12.M_Minigun XWeapons.MutNoSuperWeapon
# CB12.M_Pulse XWeapons.ZoomSuperShockBeamFire
# DE.VolatileAmmo BonusPack.MutCrateCombo
# De.TeamBeacon NoDoubleDamage.MutNoDoubleDamage
# De.VolatileWeapon
# NoInvisibility.NoInvisibility
# NoUDamage.NoUDamage
# Relics.RelicDeath
# Relics.RelicDefense
# Relics.RelicRedemption
# Relics.RelicRegen
# Relics.RelicSpeed
# Relics.RelicStrength
# ZPPure7E.AccuGib
# ZPPure7E.ColorAccuGib
# ZPPure7E.ZP_ShockArena
# ZPPure7E.ZP_SniperArena
# ZPPure7E.ZeroPing
# Example: MYMODS=NoUDamage.NoUDamage,BotPack.NoRedeemer
MYMODS=AntiTCC118h.MutAntiTCCFinal,BonusPack.MutCr ateCombo,NoDoubleDamage.MutNoDoubleDamage,UTClassi c.MutUseSniper,XWeapons.MutNoSuperWeapon,utcompv16 .MutUTComp,Zound51.Zound,

MYUSERID=wwwrun
MYDIR=/srv/www/htdocs/web7/html/ut2004_server01
MYIP=
MYINI=UT2004.ini
MYUSER=User.ini

MYLOGFILE="$MYDIR/Logs/$MYNAME.log"
MYLOCKFILE="$MYDIR/System/$MYNAME.lock"

# MAXLOGSIZE is the maximum size allowed (in kB) by the "check"
# procedure -- if "check" is called and the log size is greater than
# this value then "logrotate" will be invoked; suggested value: 1024
# set MAXLOGSIZE to 0 to disable logratate if you are having trouble
# -- you will still be able to call "logrotate" manually
MAXLOGSIZE=1024

# MAXLOGFILES is the number of backup log files that will be kept
# when "logrotate" is called; suggested value: 4
# warning: if this value is 0 then no backup log files will be kept
# and the current log will be overwritten if the logs are rotated.
MAXLOGFILES=4

# MONITORFREQ is the time (in seconds) between each call to "check"
# by the "infinity" loop; suggested value: 60
# warning: setting this too low can cause bad things to happen.
MONITORFREQ=60

# BROKENCPUTIME is the maximum %cpu usage that is allowed if this is
# exceeded in two successive checks (seperated by the amount of time
# determined by MONITORFREQ) then the server will be restarted.
# set to 0 to disable, must be below 100; suggested value: 99
# warning: setting this too low can cause the server to restart a lot
BROKENCPUTIME=99

# LOGSPAMCHECK is used to detect that the server is in a bad loop
# this can happen if the same message is output to the log over and over
# when this happens, we must restart the server -- valid values: 0 or 1
# set this to 0 if you do not want this check to happen
LOGSPAMCHECK=1

# NICELEVEL is used to attempt to run ucc at a higher priority than other tasks
# (this has no effect unless you exec this script as root)
# you must set the NICELEVEL to a negative value, which will tell the kernel
# that this process does not play "nice" with other processes and will demand
# more attention -- valid values 0 to -20
# suggested value: 0 or -10
# the "nice" command may not work in some shells, in this case set to 0
NICELEVEL=0

# CANSUID determines if the command uses "su" when executed by root
# or if it tries to chown/chmod the ucc-bin command before executing it.
# set CANSUID to zero if you have trouble -- valid values: 0 or 1
CANSUID=1

################################################## ####
#
# no user servicable parts beyond this point.
#
# if you find that you need to change anything below here,
# please contact me because i would like to ensure that this
# is no longer necessary (for any reason)
#
# send feedback to ut@abfackeln.com
# thank-you
#
################################################## ####

WriteToLog ()
{
TIME=$(date +"%Y-%m-%d %H:%M:%S")
$SUID "echo \"[$TIME] $MYNAME: $1\" >> $MYLOGFILE"
}

if [ ! -d "$MYDIR/System" ]; then
echo "ERROR: Can not find System directory in $MYDIR"
exit -2
fi

if [ ! -d "$MYDIR/Logs" ]; then
echo "ERROR: Can not find Logs directory in $MYDIR"
exit -2
fi

ulimit -c 0

if [ -z "$MYMODS" ]; then
TMP="$MYMAP""\?game=$MYGAME"
else
TMP="$MYMAP""\?game=$MYGAME""\?mutator=$MYMODS"
fi
if [ -n "$MYIP" ]; then
TMP="$TMP multihome=$MYIP"
fi
if [ -n "$MYUSER" ]; then
TMP="$TMP userini=$MYUSER"
fi
if [ -n "$MYINI" ]; then
TMP="$TMP ini=$MYINI"
fi
MYEXECMD="./ucc-bin server $TMP --nohomedir log=/dev/null"
OUTLOG="$MYLOGFILE"

SUID="bash -c"
if [ `whoami` = "root" ]; then
ATTEMPTNICE=
if [ $NICELEVEL -ne 0 ]; then
ATTEMPTNICE="nice -n $NICELEVEL"
fi

if [ "$CANSUID" = "1" ]; then
SUID="$ATTEMPTNICE su $MYUSERID -c"
else
SUID="$ATTEMPTNICE $SUID"
chown $MYUSERID $MYDIR/System/ucc-bin
chmod u+s $MYDIR/System/ucc-bin
fi
fi

case "$1" in
start)
$0 soft-start
$0 infinity &
;;
stop)
if [ -f "$MYLOCKFILE.8" ]; then
# break infinity simply by removing the lock file
rm -f $MYLOCKFILE.8
fi

$0 soft-stop
;;
restart)
$0 stop
$0 start
;;
soft-start)
echo -n "Starting Unreal Tournament: "
if [ -f $MYLOCKFILE ]; then
echo "Process is already running. Not started."
else
$0 logrotate >/dev/null
cd $MYDIR/System
WriteToLog "soft-start"
# the log file must be written with append (">>") or the logrotate
# will not work. also, we must echo the PID to the lock file on the
# same command line so that we do not create permission problems
# with the lock file if logged in as root
$SUID "$MYEXECMD >> $OUTLOG & echo \$! > $MYLOCKFILE"
echo "$MYNAME"
fi
;;
soft-stop)
echo -n "Stopping Unreal Tournament: "
if [ ! -f $MYLOCKFILE ]; then
echo "not found"
exit -4
fi
WriteToLog "soft-stop"
kill -TERM $(cat $MYLOCKFILE)
rm -f "$MYLOCKFILE"
echo "$MYNAME"
;;
soft-restart)
if [ -f $MYLOCKFILE ]; then
$0 soft-stop
fi
$0 soft-start
;;
infinity)
# "infinity" -- this command is used to start an
# infinite loop to ensure that server is always up without use of cron

$SUID "echo $$ > $MYLOCKFILE.8"

# note, overwriting the infinity (.8) lock file will kill any previous
# infinity # process because the pid will no longer match -- this is a
# good thing and saves us from trying to seek out old processes to kill
# them.

# further note, running "check" will also ensure that we kill any
# previous pids (of the non-infinity type) before restarting the server
# .. this means that any server process that may still be running
# (with a valid lock file) will be killed before restarting the server.

while [ -f $MYLOCKFILE.8 -a "$$" = "$(cat $MYLOCKFILE.8 2>/dev/null)" ]; do
$0 check
sleep $MONITORFREQ
done
;;
check)
# check if process is alive
PROC=$(cat $MYLOCKFILE 2>/dev/null)
if [ -z "$(ps -p $PROC 2>/dev/null | grep ucc)" ]; then
WriteToLog "restarting because pid died"
$0 soft-restart
exit 1
fi

# check if overworking the cpu (condition is usually unrecoverable)
if [ $BROKENCPUTIME -gt 0 ]; then
# need the zero in front in case the command substitution returns a null
CPUTIME=0$(ps auxw | sed -n -e "s/^$MYUSERID\ *$PROC\ *\([0-9]*\).*$/\1/"p)
if [ $CPUTIME -ge $BROKENCPUTIME ]; then
WriteToLog "cpu time is over $BROKENCPUTIME at $CPUTIME"
WriteToLog "Pausing for 60 seconds to see if it is still evil..."
sleep 60
CPUTIME=0$(ps auxw | sed -n -e "s/^$MYUSERID\ *$PROC\ *\([0-9]*\).*$/\1/"p)
WriteToLog "cpu time = $CPUTIME"
if [ $CPUTIME -ge $BROKENCPUTIME ]; then
$0 soft-restart
exit 1
fi
fi
fi

# check if logrotate is necessary
if [ $MAXLOGSIZE -gt 0 ]; then
# need the zero in front in case the command substitution returns a null
LOGSIZE=0$(ls -sk $MYLOGFILE | sed -n 's/^\([0-9]*\).*$/\1/p')
if [ $LOGSIZE -gt $MAXLOGSIZE ]; then
if [ $LOGSPAMCHECK = "1" -a $LOGSIZE -gt $(($MAXLOGSIZE + 1024)) ]; then
# error -- logs are waaay too big (1MB over MAXLOGSIZE)
# something must be wrong -- this may happen if stuck in an
# endless loop -- must restart server
WriteToLog "restarting because log file is more than 1MB over MAXLOGSIZE"
$0 soft-restart
else
$0 logrotate
fi
fi
fi
;;
logrotate)
if [ -s "$MYLOGFILE" ]; then
if [ $MAXLOGFILES -gt 0 ]; then
WriteToLog "Rotating logs..."
COUNT=$MAXLOGFILES
NEXTLOG="$MYLOGFILE.$COUNT"
COUNT=$(($COUNT - 1))
PREVLOG="$MYLOGFILE.$COUNT"
while [ $COUNT -gt 0 ]; do
if [ -f "$PREVLOG" ]; then
$SUID "mv $PREVLOG $NEXTLOG"
fi
NEXTLOG=$PREVLOG
COUNT=$(($COUNT - 1))
PREVLOG="$MYLOGFILE.$COUNT"
done
$SUID "cp $MYLOGFILE $NEXTLOG"
else
WriteToLog "Rotating logs... -- MAXLOGFILES is not set -- log file not saved!!"
fi
$SUID "cat /dev/null > $MYLOGFILE"
else
WriteToLog "Rotating logs... -- MYLOGFILE is empty -- not rotating!"
fi
;;
*)
echo "Usage: $0 {start|stop|restart|check|logrotate}"
exit -1
esac

exit 0

baumgartner
17.04.06, 13:19
hi


screen
strg+A - c ./ucc..........
strg+A - n screen -d


natürlich auch "man screen" ......... RTFM

Martin