I think you can add the &#39;-nohomedir&#39; option in the command line<div>then all the files the CoD4 server will want to create, are within the &#39;current&#39; folder.</div><div>You might also run into Pb wanting to create a .pbsv folder too</div>
<div><br></div><div>@Mathis:</div><div>Nice find, that way one can login like with putty and execute the cod4 server with the right user the easy way. (i think)</div><div><br></div><div>goodluck Taraman</div><div><br></div>
<div>Lambik</div><div><br></div><div><br><br><div class="gmail_quote">On Mon, Dec 14, 2009 at 5:36 PM, Mathis <span dir="ltr">&lt;<a href="mailto:admin@gunah.eu">admin@gunah.eu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">



  
  

<div bgcolor="#ffffff" text="#000000">
question....?<br>
<br>
why do u use system()/exec()...<br>
<br>
when u can use ssh_exec() ???<br>
<a href="http://php.net/manual/en/book.ssh2.php" target="_blank">http://php.net/manual/en/book.ssh2.php</a><br>
<br>
greetz gunah<br>
<br>
Taraman schrieb:
<blockquote type="cite"><div><div></div><div class="h5">
  
  
Hi all,<br>
  <br>
after the hint from Lambuk - THX!!! - I found the error.<br>
In the 2&gt; output file it says:<br>
&gt;&gt; ----- FS_Startup -----<br>
&gt;&gt; Sys_Error: Unable to create directory
&quot;/var/lib/apache2/.callofduty4&quot;, error is Permission denied(13)<br>
  <br>
So it is a permission problem after all. But what is the solution?<br>
Easiest would be to grant write privileges to this directory. But even
if security is not a problem on this machine I don&#39;t want to do it this
awful way.<br>
I tried +set fs_homepath and +set fs_basepath but that didn&#39;t help.<br>
  <br>
Is there a way to set $HOME for scripts called by apache/php?<br>
or is there another +set directive for cod4 that sets the location of
the .callofduy4 dir?<br>
  <br>
Taraman<br>
  <br>
On 13.12.2009 22:37, [FnG] Lambik wrote:
  <blockquote 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&gt; output to it aswell ;)</div>
    <div><br>
    </div>
    <div>system(&#39;/home/me/gameserver.sh cod4 start 1&gt;
/home/me/gameserver-log 2&gt;/home/me/gameerrorlog&#39;, $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">&lt;<a href="mailto:ollie.camp@gmail.com" target="_blank">ollie.camp@gmail.com</a>&gt;</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(&#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" target="_blank">b.m.schiltmans@planet.nl</a>&gt;</span>
      <div>
      <div><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><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>
      </div>
      </div>
      <br>
      <br clear="all">
      <br>
-- <br>
      <font color="#888888">Ollie<br>
      </font><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>
    </div>
    <br>
    </div>
    <pre><fieldset></fieldset>
_______________________________________________
cod mailing list
<a href="mailto:cod@icculus.org" target="_blank">cod@icculus.org</a>
<a href="http://icculus.org/mailman/listinfo/cod" target="_blank">http://icculus.org/mailman/listinfo/cod</a>
  </pre>
  </blockquote>
  </div></div><pre><hr size="4" width="90%"><div class="im">
_______________________________________________
cod mailing list
<a href="mailto:cod@icculus.org" target="_blank">cod@icculus.org</a>
<a href="http://icculus.org/mailman/listinfo/cod" target="_blank">http://icculus.org/mailman/listinfo/cod</a>
  </div></pre>
</blockquote>
<br>
</div>

<br>_______________________________________________<br>
cod mailing list<br>
<a href="mailto:cod@icculus.org">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></div><br></div>