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(&#39;/home/me/gameserver.sh cod4 start &gt; /home/me/gameserver-log&#39;, $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">&lt;<a href="mailto:b.m.schiltmans@planet.nl">b.m.schiltmans@planet.nl</a>&gt;</span><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&#39;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 &#39;stop-only&#39; 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 [ ! &quot;$1&quot; = &quot;stop-only&quot; ]; 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 &gt;&gt; /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></div><div class="h5"><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&#39;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&#39;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 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&#39;t even have Internet. Yes, there are places like that - honestly ;-)<br>
Nevertheless the gameserver is started as a &quot;normal&quot; user and the Webserver runs as the same user - NOT as root.<br>
And I wouldn&#39;t do it that way on a public machine - to calm your apprehension.<br>
<br>
As for Bram&#39;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 &quot;top&quot; 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&#39;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 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&#39;s a very insecure way to start gameservers :/<br>
<br>
<br>
On Wed, Dec 9, 2009 at 3:55 PM, &lt;<a href="mailto:b.m.schiltmans@planet.nl" target="_blank">b.m.schiltmans@planet.nl</a> &lt;mailto:<a href="mailto:b.m.schiltmans@planet.nl" target="_blank">b.m.schiltmans@planet.nl</a>&gt;&gt; wrote:<br>

<br>
    Sound like a problem with uninitialized (system)variables. When a<br>
    command is started through php, it doesn&#39;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 href="mailto:Taraman@gmx.de" target="_blank">Taraman@gmx.de</a>]<br>
    Verzonden: wo 9-12-2009 13:54<br>
    Aan: <a href="mailto:cod@icculus.org" target="_blank">cod@icculus.org</a> &lt;mailto:<a href="mailto:cod@icculus.org" target="_blank">cod@icculus.org</a>&gt;<br>
    Onderwerp: [cod] Start COD4 Linux Dedicated via Webinterface<br>
<br>
<br>
<br>
    Hi,<br>
<br>
    I&#39;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 &quot;/somedir/gameserver.sh cod4 start&quot;<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 &quot;cd<br>
    /home/me/cod4&quot; and then launches the server with Screen -dmS<br>
<br>
    In the Webinterface the script is called by PHP with<br>
    &quot;System(&#39;/home/me/gameserver.sh cod4 start&#39;, $status);&quot;<br>
    With this the Script says &quot;Server Started&quot; 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&#39;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 href="mailto:cod@icculus.org" target="_blank">cod@icculus.org</a> &lt;mailto:<a href="mailto:cod@icculus.org" target="_blank">cod@icculus.org</a>&gt;<br>
    <a 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 href="mailto:cod@icculus.org" target="_blank">cod@icculus.org</a> &lt;mailto:<a href="mailto:cod@icculus.org" target="_blank">cod@icculus.org</a>&gt;<br>
    <a 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 href="mailto:cod@icculus.org" target="_blank">cod@icculus.org</a><br>
<a href="http://icculus.org/mailman/listinfo/cod" target="_blank">http://icculus.org/mailman/listinfo/cod</a><br>
</blockquote>
_______________________________________________<br>
cod mailing list<br>
<a href="mailto:cod@icculus.org" target="_blank">cod@icculus.org</a><br>
<a 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 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 href="mailto:cod@icculus.org" target="_blank">cod@icculus.org</a><br>
<a 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 href="mailto:cod@icculus.org" target="_blank">cod@icculus.org</a><br>
<a href="http://icculus.org/mailman/listinfo/cod" target="_blank">http://icculus.org/mailman/listinfo/cod</a><br>
</blockquote>
_______________________________________________<br>
cod mailing list<br>
<a href="mailto:cod@icculus.org" target="_blank">cod@icculus.org</a><br>
<a 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 href="mailto:cod@icculus.org" target="_blank">cod@icculus.org</a><br>
<a 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 href="mailto:cod@icculus.org" target="_blank">cod@icculus.org</a><br>
<a href="http://icculus.org/mailman/listinfo/cod" target="_blank">http://icculus.org/mailman/listinfo/cod</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Ollie<br>