<!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">
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">http://php.net/manual/en/book.ssh2.php</a><br>
<br>
greetz gunah<br>
<br>
Taraman schrieb:
<blockquote cite="mid:4B2666BB.9040608@gmx.de" type="cite">
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
  <title></title>
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
"/var/lib/apache2/.callofduty4", 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't want to do it this
awful way.<br>
I tried +set fs_homepath and +set fs_basepath but that didn'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
 cite="mid:ad7b4cc0912131337l1e575afag146098b56b1d53f@mail.gmail.com"
 type="cite">I think what Ollie says a permission problem,
    <div>&nbsp;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('/home/me/gameserver.sh cod4 start 1&gt;
/home/me/gameserver-log 2&gt;/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">&lt;<a moz-do-not-send="true"
 href="mailto:ollie.camp@gmail.com">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('/home/me/gameserver.sh cod4 start &gt;
/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.&nbsp; 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 moz-do-not-send="true"
 href="mailto:b.m.schiltmans@planet.nl" target="_blank">b.m.schiltmans@planet.nl</a>&gt;</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>
&nbsp;# call scripts that allows auto-balancing of teams bases on statistics
for stats-pages (very nice if I may say so ;-) )<br>
&nbsp;/home/games/csscripts/teamgenerator.sh cod4<br>
&nbsp;# change to right directory<br>
&nbsp;cd /home/games/cod4/<br>
&nbsp;# get a random map to start with<br>
&nbsp;cp /home/games/cod4/maplist.txt_org /home/games/cod4/maplist.txt<br>
&nbsp;ls /home/games/cod4/usermaps &gt;&gt; /home/games/cod4/maplist.txt<br>
&nbsp;STARTMAP=`php /home/games/csscripts/shuffle_file.php
/home/games/cod4/maplist.txt /home/games/cod4/maplist.txt`<br>
&nbsp;# start the server<br>
&nbsp;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>
&nbsp;# start an extra script that auto-switches players in teamspeak based
on the team they are currently in<br>
&nbsp;/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, &lt;<a moz-do-not-send="true"
 href="mailto:b.m.schiltmans@planet.nl" target="_blank">b.m.schiltmans@planet.nl</a>
&lt;mailto:<a moz-do-not-send="true"
 href="mailto:b.m.schiltmans@planet.nl" target="_blank">b.m.schiltmans@planet.nl</a>&gt;&gt;
wrote:<br>
                  <br>
&nbsp; &nbsp;Sound like a problem with uninitialized (system)variables. When a<br>
&nbsp; &nbsp;command is started through php, it doesn't load your profile and<br>
&nbsp; &nbsp;therefor things like your path are not set. Try including paths on<br>
&nbsp; &nbsp;all commands, so /usr/bin/screen instead of just screen.<br>
                  <br>
&nbsp; &nbsp;Hope that helps.<br>
&nbsp; &nbsp;Grtz<br>
&nbsp; &nbsp;Bram<br>
                  <br>
                  <br>
&nbsp; &nbsp;-----Oorspronkelijk bericht-----<br>
&nbsp; &nbsp;Van: Taraman [mailto:<a moz-do-not-send="true"
 href="mailto:Taraman@gmx.de" target="_blank">Taraman@gmx.de</a>]<br>
&nbsp; &nbsp;Verzonden: wo 9-12-2009 13:54<br>
&nbsp; &nbsp;Aan: <a moz-do-not-send="true" href="mailto:cod@icculus.org"
 target="_blank">cod@icculus.org</a> &lt;mailto:<a
 moz-do-not-send="true" href="mailto:cod@icculus.org" target="_blank">cod@icculus.org</a>&gt;<br>
&nbsp; &nbsp;Onderwerp: [cod] Start COD4 Linux Dedicated via Webinterface<br>
                  <br>
                  <br>
                  <br>
&nbsp; &nbsp;Hi,<br>
                  <br>
&nbsp; &nbsp;I'm just programming a Webinterface for our LAN-server.<br>
&nbsp; &nbsp;My problem is, that the cod4 server does not start via the<br>
&nbsp; &nbsp;Webinterface.<br>
                  <br>
&nbsp; &nbsp;I have a Shell-script called gameserver.sh that starts the different<br>
&nbsp; &nbsp;servers via "/somedir/gameserver.sh cod4 start"<br>
&nbsp; &nbsp;This script works fine when used from a terminal - also if called
from<br>
&nbsp; &nbsp;different directories. The Server itself is then running like a
charm.<br>
&nbsp; &nbsp;The Script basically changes the directory to the game directory<br>
&nbsp; &nbsp;via "cd<br>
&nbsp; &nbsp;/home/me/cod4" and then launches the server with Screen -dmS<br>
                  <br>
&nbsp; &nbsp;In the Webinterface the script is called by PHP with<br>
&nbsp; &nbsp;"System('/home/me/gameserver.sh cod4 start', $status);"<br>
&nbsp; &nbsp;With this the Script says "Server Started" and the program is<br>
&nbsp; &nbsp;launched,<br>
&nbsp; &nbsp;but the process dies again immediately.<br>
                  <br>
&nbsp; &nbsp;I have a hard time debugging the error, because I don't get any error<br>
&nbsp; &nbsp;messages. The server does not live long enough to write a log and the<br>
&nbsp; &nbsp;PHP System command does not give me any useful output (I also tried
to<br>
&nbsp; &nbsp;start the server directly).<br>
                  <br>
&nbsp; &nbsp;Does anyone have an Idea, what the problem is, or how I can get
useful<br>
&nbsp; &nbsp;error Information?<br>
                  <br>
&nbsp; &nbsp;Taraman<br>
                  <br>
&nbsp; &nbsp;_______________________________________________<br>
&nbsp; &nbsp;cod mailing list<br>
&nbsp; &nbsp;<a moz-do-not-send="true" href="mailto:cod@icculus.org"
 target="_blank">cod@icculus.org</a> &lt;mailto:<a
 moz-do-not-send="true" href="mailto:cod@icculus.org" target="_blank">cod@icculus.org</a>&gt;<br>
&nbsp; &nbsp;<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>
&nbsp; &nbsp;_______________________________________________<br>
&nbsp; &nbsp;cod mailing list<br>
&nbsp; &nbsp;<a moz-do-not-send="true" href="mailto:cod@icculus.org"
 target="_blank">cod@icculus.org</a> &lt;mailto:<a
 moz-do-not-send="true" href="mailto:cod@icculus.org" target="_blank">cod@icculus.org</a>&gt;<br>
&nbsp; &nbsp;<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 moz-do-not-send="true" class="moz-txt-link-abbreviated"
 href="mailto:cod@icculus.org">cod@icculus.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext"
 href="http://icculus.org/mailman/listinfo/cod">http://icculus.org/mailman/listinfo/cod</a>
  </pre>
  </blockquote>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
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>
<br>
</body>
</html>