<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Olli and Lambik,<br>
<br>
Thats what I thought at first, but I'm preety sure it's not about
permissions.<br>
I run Apache as the same user that runs the gameservers.<br>
Is php run as a different user or does it take the UID from Apache? If
it has an own user ID set, where can I change that?<br>
<br>
Nevertheless I will try to run the webserver as root, just to see if it
changes anything.<br>
Also I will have a look what the output to files says.<br>
<br>
Taraman<br>
<br>
On 13.12.2009 22:37, [FnG] Lambik wrote:
<blockquote
cite="mid:ad7b4cc0912131337l1e575afag146098b56b1d53f@mail.gmail.com"
type="cite">I think what Ollie says a permission problem,
<div> the webserver run on a certain user, and does that user have
the right permissions on the CoD4 server files ?</div>
<div>Do you have SUEXEC on the webserver enabled ?</div>
<div>btw, add the 2> output to it aswell ;)</div>
<div><br>
</div>
<div>system('/home/me/gameserver.sh cod4 start 1>
/home/me/gameserver-log 2>/home/me/gameerrorlog', $status);<br>
<br>
</div>
<div>Lambik</div>
<div><br>
<div class="gmail_quote">On Sun, Dec 13, 2009 at 10:18 PM, Ollie Camp
<span dir="ltr"><<a moz-do-not-send="true"
href="mailto:ollie.camp@gmail.com">ollie.camp@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Sounds
like its a permission problem...<br>
<br>
It might be that php is running as either root or nobody (depending on
how your apache is setup and php).<br>
<br>
Try calling the script like this. <br>
system('/home/me/gameserver.sh cod4 start >
/home/me/gameserver-log', $status);<br>
<br>
That will dump any terminal input into a text file which you can thn
view to see if it chucks any errors out (ie permission problems)<br>
<br>
Hope that makes sense?<br>
<br>
I personally have complied php with ssh2 and just get my webscript to
login on ssh as the correct user and then start the server into
screen. Then when i want it shutdown it logs back in and kills the
screen session. Advantage of using screen is that i can logina s the
use and check weather <br>
<br>
<br>
<br>
<div class="gmail_quote">2009/12/13 B.M. Schiltmans <span dir="ltr"><<a
moz-do-not-send="true" href="mailto:b.m.schiltmans@planet.nl"
target="_blank">b.m.schiltmans@planet.nl</a>></span>
<div>
<div class="h5"><br>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Not
sure if it's going to be much use, but here we go.<br>
Script is called rotatecod4 and without arguments it (re)starts cod4.
When supplied with 'stop-only' as argument it ... just stops the server.<br>
I added some extra comment-lines to make it a bit readable. Could have
removed a few lines, but I just wanted to show off ;-)<br>
<br>
#!/bin/sh<br>
# kill the running server, if any<br>
killall cod4_lnxded-bin<br>
# move the logfile for our stats-pages<br>
chmod o+rw /home/games/.callofduty4/mods/lanparty/Server1_mp.log<br>
mv /home/games/.callofduty4/mods/lanparty/Server1_mp.log
/home/games/logfiles/cod4/`date +%d-%m-%y_%T.log`<br>
<br>
if [ ! "$1" = "stop-only" ]; then<br>
# call scripts that allows auto-balancing of teams bases on statistics
for stats-pages (very nice if I may say so ;-) )<br>
/home/games/csscripts/teamgenerator.sh cod4<br>
# change to right directory<br>
cd /home/games/cod4/<br>
# get a random map to start with<br>
cp /home/games/cod4/maplist.txt_org /home/games/cod4/maplist.txt<br>
ls /home/games/cod4/usermaps >> /home/games/cod4/maplist.txt<br>
STARTMAP=`php /home/games/csscripts/shuffle_file.php
/home/games/cod4/maplist.txt /home/games/cod4/maplist.txt`<br>
# start the server<br>
screen -d -m /home/games/cod4/cod4_lnxded-bin +set dedicated 1 +exec
hardcore.cfg +map_rotate +map $STARTMAP +set fs_game mods/lanparty<br>
# start an extra script that auto-switches players in teamspeak based
on the team they are currently in<br>
/home/games/csscripts/rotatetsas.sh
/home/games/.callofduty4/mods/lanparty/Server1_mp.log<br>
fi
<div>
<div><br>
<br>
Grtz<br>
Bram<br>
<br>
<br>
Taraman wrote:<br>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Bram,<br>
<br>
WOW, I'm impressed. That is one nice piece of work.<br>
<br>
As for my problem:<br>
I use cod4_lnxded as executable, but also tried the -bin already.<br>
The command line is right now:<br>
+exec server.cfg +map mp_crash +set dedicated 1<br>
<br>
options I also tried:<br>
+set fs_homepath<br>
+set fs_basepath<br>
<br>
What is your commandline for a LAN-Setup?<br>
<br>
For my part I chose direct control because it should stay simple and
mainly be a backup when I cannot visit myself at one of our meetings
(we are normally around 8-10 people). So this really is a private use
thing.<br>
<br>
Taraman<br>
<br>
On 11.12.2009 20:11, B.M. Schiltmans wrote:<br>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
If the others run fine, I can't really think of anything cod-specific
that could go wrong.<br>
Which executeable do you see in top cod4_lnxded or cod4_lnxded-bin, and
whats you exact command-line?<br>
<br>
We have a setup quite like yours, perhaps we could share some ideas?<br>
To begin with some sharing ;-), take a look here : <a
moz-do-not-send="true" href="http://lanparty.cil.nu/" target="_blank">http://lanparty.cil.nu/</a><br>
Instead of starting the gameservers through a webinterface, we let
players vote for which game they want to play, and then a scripts is
run to count the votes and start the winning game. Works great ;-)<br>
Two main reasons for not having direct control:<br>
- security, we run the same thing on lans, but also on our website for
evening fun<br>
- we only run one gameserver at a time because otherwise people tent to
spread out over games more instead of playing together.<br>
Af course it all depends on how big your lan-events are.<br>
<br>
Grtz<br>
Bram<br>
<br>
Taraman wrote:<br>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
Thx for the comments.<br>
First of all: Security is not an issue here, because its a LAN-only
server and at the Site we do our LAN-Parties (me and some Friends) we
don't even have Internet. Yes, there are places like that - honestly ;-)<br>
Nevertheless the gameserver is started as a "normal" user and the
Webserver runs as the same user - NOT as root.<br>
And I wouldn't do it that way on a public machine - to calm your
apprehension.<br>
<br>
As for Bram's comment:<br>
Good hint, I definitely have a closer look at that.<br>
But I fear thats not the problem, because of a fact that I forgot in
the description:<br>
I start two other Gameservers (CSS and BF2) via the exact same script
and checked severeal times the calls are really identical.<br>
These two work perfectly.<br>
Only the cod4 server starts very shortly (it just shows up for a moment
in "top" and then disappears again.)<br>
<br>
Thats why I started asking here, bacause it seems to be beacuse of
something thats different on the cod-server.<br>
<br>
Taraman<br>
<br>
Tyson schrieb:<br>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Yes please. Including system paths that are typically the same on every<br>
machine running the same OS isn't insecure last I knew.<br>
<br>
Setting wrong permissions on the other or running as root is.<br>
<br>
So please enlighten us and provide sources.<br>
<br>
Tyson<br>
<br>
<br>
<br>
-----Original Message-----<br>
From: B.M. Schiltmans [mailto:<a moz-do-not-send="true"
href="mailto:b.m.schiltmans@planet.nl" target="_blank">b.m.schiltmans@planet.nl</a>]
Sent: Wednesday, December 09, 2009 10:12 AM<br>
To: Call of Duty server admin list.<br>
Subject: Re: [cod] Start COD4 Linux Dedicated via Webinterface<br>
<br>
Well if you explain yourself a bit further we might just learn
something here.<br>
Humor me, plz...<br>
<br>
Marco Padovan wrote:<br>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
that's a very insecure way to start gameservers :/<br>
<br>
<br>
On Wed, Dec 9, 2009 at 3:55 PM, <<a moz-do-not-send="true"
href="mailto:b.m.schiltmans@planet.nl" target="_blank">b.m.schiltmans@planet.nl</a>
<mailto:<a moz-do-not-send="true"
href="mailto:b.m.schiltmans@planet.nl" target="_blank">b.m.schiltmans@planet.nl</a>>>
wrote:<br>
<br>
Sound like a problem with uninitialized (system)variables. When a<br>
command is started through php, it doesn't load your profile and<br>
therefor things like your path are not set. Try including paths on<br>
all commands, so /usr/bin/screen instead of just screen.<br>
<br>
Hope that helps.<br>
Grtz<br>
Bram<br>
<br>
<br>
-----Oorspronkelijk bericht-----<br>
Van: Taraman [mailto:<a moz-do-not-send="true"
href="mailto:Taraman@gmx.de" target="_blank">Taraman@gmx.de</a>]<br>
Verzonden: wo 9-12-2009 13:54<br>
Aan: <a moz-do-not-send="true" href="mailto:cod@icculus.org"
target="_blank">cod@icculus.org</a> <mailto:<a
moz-do-not-send="true" href="mailto:cod@icculus.org" target="_blank">cod@icculus.org</a>><br>
Onderwerp: [cod] Start COD4 Linux Dedicated via Webinterface<br>
<br>
<br>
<br>
Hi,<br>
<br>
I'm just programming a Webinterface for our LAN-server.<br>
My problem is, that the cod4 server does not start via the<br>
Webinterface.<br>
<br>
I have a Shell-script called gameserver.sh that starts the different<br>
servers via "/somedir/gameserver.sh cod4 start"<br>
This script works fine when used from a terminal - also if called
from<br>
different directories. The Server itself is then running like a
charm.<br>
The Script basically changes the directory to the game directory<br>
via "cd<br>
/home/me/cod4" and then launches the server with Screen -dmS<br>
<br>
In the Webinterface the script is called by PHP with<br>
"System('/home/me/gameserver.sh cod4 start', $status);"<br>
With this the Script says "Server Started" and the program is<br>
launched,<br>
but the process dies again immediately.<br>
<br>
I have a hard time debugging the error, because I don't get any error<br>
messages. The server does not live long enough to write a log and the<br>
PHP System command does not give me any useful output (I also tried
to<br>
start the server directly).<br>
<br>
Does anyone have an Idea, what the problem is, or how I can get
useful<br>
error Information?<br>
<br>
Taraman<br>
<br>
_______________________________________________<br>
cod mailing list<br>
<a moz-do-not-send="true" href="mailto:cod@icculus.org"
target="_blank">cod@icculus.org</a> <mailto:<a
moz-do-not-send="true" href="mailto:cod@icculus.org" target="_blank">cod@icculus.org</a>><br>
<a moz-do-not-send="true"
href="http://icculus.org/mailman/listinfo/cod" target="_blank">http://icculus.org/mailman/listinfo/cod</a><br>
<br>
<br>
_______________________________________________<br>
cod mailing list<br>
<a moz-do-not-send="true" href="mailto:cod@icculus.org"
target="_blank">cod@icculus.org</a> <mailto:<a
moz-do-not-send="true" href="mailto:cod@icculus.org" target="_blank">cod@icculus.org</a>><br>
<a moz-do-not-send="true"
href="http://icculus.org/mailman/listinfo/cod" target="_blank">http://icculus.org/mailman/listinfo/cod</a><br>
<br>
<br>
------------------------------------------------------------------------
<br>
<br>
_______________________________________________<br>
cod mailing list<br>
<a moz-do-not-send="true" href="mailto:cod@icculus.org"
target="_blank">cod@icculus.org</a><br>
<a moz-do-not-send="true"
href="http://icculus.org/mailman/listinfo/cod" target="_blank">http://icculus.org/mailman/listinfo/cod</a><br>
</blockquote>
_______________________________________________<br>
cod mailing list<br>
<a moz-do-not-send="true" href="mailto:cod@icculus.org"
target="_blank">cod@icculus.org</a><br>
<a moz-do-not-send="true"
href="http://icculus.org/mailman/listinfo/cod" target="_blank">http://icculus.org/mailman/listinfo/cod</a><br>
<br>
No virus found in this incoming message.<br>
Checked by AVG - <a moz-do-not-send="true" href="http://www.avg.com"
target="_blank">www.avg.com</a> Version: 9.0.709 / Virus Database:
270.14.101/2555 - Release Date: 12/09/09<br>
12:41:00<br>
<br>
_______________________________________________<br>
cod mailing list<br>
<a moz-do-not-send="true" href="mailto:cod@icculus.org"
target="_blank">cod@icculus.org</a><br>
<a moz-do-not-send="true"
href="http://icculus.org/mailman/listinfo/cod" target="_blank">http://icculus.org/mailman/listinfo/cod</a><br>
<br>
</blockquote>
------------------------------------------------------------------------
<br>
<br>
_______________________________________________<br>
cod mailing list<br>
<a moz-do-not-send="true" href="mailto:cod@icculus.org"
target="_blank">cod@icculus.org</a><br>
<a moz-do-not-send="true"
href="http://icculus.org/mailman/listinfo/cod" target="_blank">http://icculus.org/mailman/listinfo/cod</a><br>
</blockquote>
_______________________________________________<br>
cod mailing list<br>
<a moz-do-not-send="true" href="mailto:cod@icculus.org"
target="_blank">cod@icculus.org</a><br>
<a moz-do-not-send="true"
href="http://icculus.org/mailman/listinfo/cod" target="_blank">http://icculus.org/mailman/listinfo/cod</a><br>
<br>
</blockquote>
_______________________________________________<br>
cod mailing list<br>
<a moz-do-not-send="true" href="mailto:cod@icculus.org"
target="_blank">cod@icculus.org</a><br>
<a moz-do-not-send="true"
href="http://icculus.org/mailman/listinfo/cod" target="_blank">http://icculus.org/mailman/listinfo/cod</a><br>
<br>
</blockquote>
_______________________________________________<br>
cod mailing list<br>
<a moz-do-not-send="true" href="mailto:cod@icculus.org"
target="_blank">cod@icculus.org</a><br>
<a moz-do-not-send="true"
href="http://icculus.org/mailman/listinfo/cod" target="_blank">http://icculus.org/mailman/listinfo/cod</a><br>
</div>
</div>
</blockquote>
</div>
</div>
</div>
<br>
<br clear="all">
<br>
-- <br>
<font color="#888888">Ollie<br>
</font><br>
_______________________________________________<br>
cod mailing list<br>
<a moz-do-not-send="true" href="mailto:cod@icculus.org">cod@icculus.org</a><br>
<a moz-do-not-send="true"
href="http://icculus.org/mailman/listinfo/cod" target="_blank">http://icculus.org/mailman/listinfo/cod</a><br>
<br>
</blockquote>
</div>
<br>
</div>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
cod mailing list
<a class="moz-txt-link-abbreviated" href="mailto:cod@icculus.org">cod@icculus.org</a>
<a class="moz-txt-link-freetext" href="http://icculus.org/mailman/listinfo/cod">http://icculus.org/mailman/listinfo/cod</a>
</pre>
</blockquote>
</body>
</html>