The Unreal Admins Page - Forums

The Unreal Admins Page - Forums (https://unrealadmin.org/forums/index.php)
-   UT2003/4 Server - Linux Specific (https://unrealadmin.org/forums/forumdisplay.php?f=107)
-   -   Server not starting when using screen "signal: SIGHUP [hangup]" (https://unrealadmin.org/forums/showthread.php?t=6859)

trulli 3rd July, 2004 04:09 PM

Server not starting when using screen "signal: SIGHUP [hangup]"
 
just installed Fedora core 2 x86_64 on my new server (dual opteron 242)

i configured a ut2k4server on it.. when i start these servers without a screen session everything is ok.. but when i add screen -S <name> to the start script, the server wants to start and while starting it puts out the following:

Code:

issing Class Class Editor.TransBuffer
Browse: CTF-Drunklet-PRO?game=XGame.xCTFGame?mutator=XGame.MutInstaGib,XGame.MutNoAdrenaline
ProcMesh 0 shared verts.
Collecting garbage
Purging garbage
Garbage: objects: 35791->35782; refs: 400143
Game class is 'xCTFGame'
Bringing Level CTF-Drunklet-PRO.myLevel up for play (40) appSeconds: 9.165968...
Loading Admins & Groups
Kick and Ban Privileges Loaded
Maps & Game Privileges Loaded
Admins & Groups Management Loaded
Extra Privileges Loaded
Mutators XGame.MutInstaGib,XGame.MutNoAdrenaline
GameInfo::InitGame : bEnableStatLogging False
Spawning Anti Bypass Tool
UdpServerQuery(crt): Port 7787 successfully bound.
Resolving master0.gamespy.com...
MasterServerUplink: MasterServerGameStats not found - stats uploading disabled.
Signal: SIGHUP [hangup]
Requesting Exit.
appRequestExit(0)
Resolving ut2004master1.epicgames.com...
Loading Available Maps
Loading Game Types
Mutator exported successfully: SpiderSteroids.MutSpiderSteroidReplacer
Weapon exported successfully: SpiderSteroids.SpiderSteroidLayer
XWebAdmin.UTServerAdmin Initialized on port 7780
Success - 0 error(s), 1 warning(s)

when i start the server without a screen session in the script it works fine.

would b nice if some1 knows why it's exiting with:

Code:

Signal: SIGHUP [hangup]
Requesting Exit.
appRequestExit(0)

never seen it before

trulli 3rd July, 2004 05:47 PM

btw, i tried to make a new config.. but this 1 had the same error.. and it doesnt matter what patch i'm installing.

any1 know's what's wrong?

Korben 6th July, 2004 03:21 AM

Trulli,

What is the command you're using to start screen? I use:

screen -dmS myserver ./ucc-bin ......

That starts the screen in 'detached' mode. Hope that helps.

Brian

trulli 6th July, 2004 12:47 PM

well i tried serveral things.. the first thing i used was idd "-dmS" that didnt work so i tried "-S".. neither of these work.. but the strange thing is.. when i start a screen session manually and start a server in it.. and detach it... the server stays up.

Undy 10th July, 2004 03:31 PM

Hmz i have the same problem with fedora 1
2.6.6 kernel.

Then it runs but i cant enter the server etc.
When i start it with a manuel screen -S 2k4 ./ucc etc it runs good.
But i also cant use any other start/stop scripts from these forums.
This wasnt when i had the 2.4.x kernel so i think there is some problem in the new kernel.

jsumners 16th July, 2004 04:54 AM

I have encountered this problem as well. What is happening is screen is sending SIGHUP because the terminal is hanging up. See http://www.wlug.org.nz/SIGHUP for more info.

Sadly, I have not been able to get ucc-bin to ignore this signal and continue loading. I am unsure why it doesn't receive the signal when the session is detached manually because it should be being sent then as well.

I filed this bug https://bugzilla.icculus.org/show_bug.cgi?id=1861 but I don't really know if it is a fault of ucc-bin or not.

Naked_Ape 16th July, 2004 10:06 AM

Quote:

Originally Posted by jsumners
I have encountered this problem as well. What is happening is screen is sending SIGHUP because the terminal is hanging up. See http://www.wlug.org.nz/SIGHUP for more info.

I get this too under 2.6 but my ucc-bin just terminates, no mention of SIGHUP. And screen should *not* send a SIGHUP when detatching, the sole purpose of screen is to isolate the application from the controlling terminal. If you have verified that screen actually does send a SIGHUP you should report that to the screen developers.

Quote:

Originally Posted by jsumners
Sadly, I have not been able to get ucc-bin to ignore this signal and continue loading. I am unsure why it doesn't receive the signal when the session is detached manually because it should be being sent then as well.

I filed this bug https://bugzilla.icculus.org/show_bug.cgi?id=1861 but I don't really know if it is a fault of ucc-bin or not.

ucc-bin probably shouldn't ignore the SIGHUP signal so ucc-bin isn't at fault. Since this appeared under 2.6 kernels while 2.4 works just fine I believe this is a problem with screen and the kernel.

jsumners 16th July, 2004 03:23 PM

If you run it through strace and trace the signals you will see that the last signal sent is SIGHUP (`strace -e trace=signal screen -dmS ut2004 ./ucc-bin server <...>`). I am seeking further assistance on the screen mailing list and will keep this thread updated as I figure out more about it.

It is terribly annoying that I got everything configured the way I want and my script written only to find out that ucc-bin refuses to work properly with screen.

jsumners 16th July, 2004 06:27 PM

Okay folks, I have a solution. I am just going to paste the script I have written to run my server(s) and you can take from it what you will. I designed it so that it can be run from a crontab every thirty minutes or so to make sure the server is running without me having to do anything. What I found the problem to be is that ucc-bin was getting the hangup signal too early, i.e. before the main program loop, and was thusly shutting down. This script also fixes an issue with Debian (Woody) not being able to run it because the binary is linked with gcc3.2.

Enjoy.

Code:

#!/bin/sh
#
# This script was written by James Sumners <[email protected]>.
# No guarantees are made as to its function.
#
# This script requires the 'screen' utility to be installed and in
# the scripts PATH. Sure, it could have been done with pid files
# but I like to be able to attach to the server and watch it.
#
# This script was written and test on Debian (Woody).
#
#



# Modify these variables as you wish.
# The INI_FILE and LOG_FILE variables are relative to ~/.ut2004/System/
# So, the default setup will use the ini file:
#      ~/.ut2004/System/00deathmatch.ini
# This is a limit of Unreal that I do not know how to over come.
#
DATE=`date +"%d_%B_%Y"` # Used to name the log file
SESSION_NAME="deathmatch" # Used to identify if this script has already been run (useful if you run more than one server)
GAME_DIR="/usr/games/ut2004/System" # Path to the UT2004 "System" directory
GAME="DM-CBP2-KillbillyBarn?game=XGame.xDeathMatch?Mutator=XGame.MutUDamageReward" # Basic game options (Gametype, Mutators, extra options, etc.)
PORT="7777" # The port that the server will use
INI_FILE="00deathmatch.ini" # The ini file you wish to use with this server
LOG_FILE="logs/deathmatch/ut2004.log" # The log file for this server

# The following line is useful on Debian Woody using this package:
#      http://icculus.org/updates/cod/gcc3-libs.tar.bz2
# Modify it to suit your system if need be.
LD_LIBRARY_PATH=${HOME}/gcc3:$LD_LIBRARY_PATH

### YOU SHOULD NOT HAVE TO MODIFY ANYTHING BELOW THIS LINE ###

# Determine if the server is already running.
screen -list | grep ${SESSION_NAME} > /dev/null
case $? in
        [0]*)
                # The server is already running so we don't need to run it again.
                echo "Error: Server already running. Script exiting."
                exit 1
                ;;
        [1]*)
                # Start the server in the background.
                cd ${GAME_DIR}
                screen -dmS ${SESSION_NAME} bash -c ""LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" ./ucc-bin server ${GAME} "port=${PORT}" "ini=${INI_FILE}" "log=${LOG_FILE}"; sleep 30"
                ;;
esac


trulli 16th July, 2004 07:30 PM

Quote:

# Modify these variables as you wish.
# The INI_FILE and LOG_FILE variables are relative to ~/.ut2004/System/
# So, the default setup will use the ini file:
# ~/.ut2004/System/00deathmatch.ini
# This is a limit of Unreal that I do not know how to over come.
#
just add "-nohomedir" to the end of your "$GAME" line. then it will use the ini file in ur standard directory

and btw, the scripts works fine when i'm logged in as root, but not as user. it isn't starting a screen session but only the bash and ./ucc-bin. think it's just my fault tho ;p

jsumners 16th July, 2004 07:43 PM

I specifically designed the script to NOT use '-nohomedir' though you can if you wish. I run the server with an unprivileged user. There is absolutely no way in hell I will run the server as root. This is a VERY public service and can be exploited; I will not give the exploiter root permissions on a silver platter. When I say that I can not overcome it using "~/.ut2004/System/<whatever>.ini" I mean that I want to be able to specify an arbitray ini in an arbitrary location such as "~/server_inis/deathmatch.ini". If you can tell me how to do that I would appreciate it.

meth 24th November, 2004 10:33 PM

Any progress on this?


screen -mdS test bash -c ""LD_LIBRARY_PATH=../libs" ./ucc-bin server CTF-BridgeOfFate?game=XGame.xCTFGame port=7777 ini=server.ini -nohomedir"


Doesnt work, even with full path to the libs.

Is it related the version of screen or the kernel itself?

Why is it even sighuping?

jsumners 24th November, 2004 11:47 PM

Did you look at the script?

meth 25th November, 2004 12:02 AM

I've looked at the script, cant use an entire script.. I need the screen line to start it.

Is this not fixed in the new patch of unreal 3323? Sucks that I have to dl a torrent and upload 50x more then I download to get it directly :(

PsychoChihuahua 25th November, 2004 04:45 AM

Screen is nice, but not necessary. Just nohup the process(es).

NOHUP=/usr/bin/nohup
GAMEDIR=/usr/local/games/ut2k4server
LOGDIR=${GAMEDIR}/logs
LOG=${GAMEDIR}/ut2004-server.log
SERVER=${GAMEDIR}/System/ucc-bin
INIFILE=${GAMEDIR}/System/ut2004.ini
ADMINNAME='AdminName=ChangeMeBeforeUsing'
ADMINPASS='AdminPassword=ChangeMeBeforeUsing'
MUTATORS='Mutator=XGame.MutQuadJump,XGame.MutFastW eapSwitch,Onslaught.MutOnslaughtWeapons'
GAMETYPE=$1 (paraphrased)

${NOHUP} ${SERVER} server "${GAMETYPE}?${ADMINNAME}?${ADMINPASS}?${MUTAT ORS} -ini=${INIFILE} -nohomedir" >> ${LOG} 2>&1

(From a start script which I wrote, as a UID other than root.)

PsychoChihuahua 25th November, 2004 04:45 AM

-ini=/some/nondescript/path/to/some_ini_file

Quote:

Originally Posted by jsumners
When I say that I can not overcome it using "~/.ut2004/System/<whatever>.ini" I mean that I want to be able to specify an arbitray ini in an arbitrary location such as "~/server_inis/deathmatch.ini". If you can tell me how to do that I would appreciate it.


meth 25th November, 2004 05:15 AM

I have to use screen, weird that unreal would be the ONLY game ive found that wont work in screen on 2.6 kernels, hm.

Naked_Ape 25th November, 2004 06:38 AM

meth, I can't remeber what I did to fix this but I'm running UT2k4 with a 2.6.x kernel (Debian GNU/Linux /w custom kernel) just fine. Are you still having problems?

meth 25th November, 2004 02:59 PM

yup

PsychoChihuahua 25th November, 2004 10:51 PM

Why do you have to use screen, just out of curiosity?


All times are GMT +1. The time now is 07:45 AM.

 


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