Running processes as non-root is general advice
for all server processes. Any security flaw in a
process running as root will mean that the whole
system can get compromised. By running the process
with the privileges of a normal user, you effectively
limit any such compromise to the user's own
permissions, thus preventing an attacker from
obtaining full control of your host.
Actually, I've been experiencing the exact same
problem with BF2 as described above for one of
my subdomains. start.sh includes the exec-line,
yet the server won't start when launched via GC,
but starts just fine if run from the command-line.
When launching from GC, the server process is
immediately marked as defunct (zombie). Since
this has been working for another of my subdomains
which uses a custom start.sh, I went ahead and
modified it for this subdomain as well. So now it
works, but it seems as if the default installation
won't work unless we jump through a few loops.
I am also having problems with CS 1.6 and Q4, but that's
a different story for a possibly different thread...
Well, it's not a very straightforward fix, but it seems
to be working okay:
1. Rename start.sh to start_orig.sh
2. Create a new start.sh like this:
Code:
#!/bin/bash
STARTSCREEN=1
# exec and -D since we can't spawn a new process when using GameCreate
if [ ${STARTSCREEN} == "1" ]; then
screen -wipe >/dev/null # Make sure all dead screens are removed
exec screen -m -D -A ./start_orig.sh $@
else
exec ./start_orig.sh $@
fi
Like I mentioned above, this is just a very trimmed
down version of our custom-script which does quite
a bit more. But this seems to work. _and_ it has the
added bonus of putting the server into a screened
session.
i haven't tried with $STARTSCREEN != 0, but it should
also work.
Funny thing is that in essence this approach causes
two execs to happen. By just using the original one,
GC barfs.
I am afraid I don't have time to look for a cleaner
solution to this - the subdomain in question is for
compos for a LAN with 2500+ people and USD 80k
in prizes which start in another day or so, so I'd
better get cracking on getting Q4 and CS1.6 to
behave
Edit: The problem with CS 1.6 was a " at the end of
the command-line. This caused only the first port
to be used according to netstat. Since GC was unable
to detect the server as running when querying it, it
restarted the server. Since it was working fine when
I ran the command manually, naturally neglecting
the ", this was very confusing! But it seems to be
working fine now. On to Quake 4!
Edit2: Q4 is working too. Just one of those wow-it-
just-suddenly-worked-experiences. Now we're all
set, I hope.
It seems like BF2142 needs a similar solution to
the one above for BF2. Running the original start.sh
directly doesn't start the server, and GC keeps
retrying, even though it works perfectly from the
command-line. Renaming start.sh to e.g. start_orig.sh
and creating a new start.sh containing the following
works just fine:
Code:
#!/bin/bash
exec screen -m -D -A ./start_orig.sh $@
It seems to me that there's something fishy about
the way GC detects running processes, and it's related
to the forking/exec'ing, though I won't try to guess
at the exact mechanism at work here.
As far as I can remember, using the original start.sh
used to work some months ago, but since I've been
using a modified version like the one above for
ages, I can't really say when the problems started.
Hope you will be able to sort this one out, since it
really shouldn't be necessary to use a hack like this
to start the game - at the very best it will confuse
a lot of users
#!/bin/bash
STARTSCREEN=1
# exec and -D since we can't spawn a new process when using GameCreate
if [ ${STARTSCREEN} == "1" ]; then
screen -wipe >/dev/null # Make sure all dead screens are removed
exec screen -m -D -A ./start_orig.sh $@
else
exec ./start_orig.sh $@
fi
Quote:
#!/bin/bash
exec screen -m -D -A ./start_orig.sh $@
We are still using the same solution as mentioned above without any problems.
1. Exactly what happens when you try to start the server from GC?
2. Have you run the exact commandline listed on the server's overview page from the shell (substituting start.sh with start_orig.sh)? It should look like "start_orig.sh +config "configs/16567/serversettings.con" +mapList "configs/16567/maplist.con" +pbPath ..."
3. Is start_orig.sh executable?
Code:
chmod +x start_orig.sh
4. Have you turned off support for screen on /admin/EditGameConfiguration.aspx?id=119 ?
All times are GMT + 10 Hours Goto page Previous1, 2, 3, 4Next
Page 3 of 4
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum