LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Screen cannot make directory (https://www.linuxquestions.org/questions/linux-server-73/screen-cannot-make-directory-925798/)

h3llkill3r 01-26-2012 09:51 AM

Screen cannot make directory
 
I made this script with php

PHP Code:

$name="CoD2-test";
$extra="+set net_port 28990 +set g_gametype sd +map mp_toujane";
$dir="/home/servers/cod2/War_Servers";
$exe="cod2_lnxded";

$exec=$dir."/".$exe;

echo 
shell_exec('cd '.$dir);
echo 
shell_exec('screen -d -m -S root '.$name.$exec.$extra); 

and when I run it it give me this error.

Cannot make directory '/var/run/screen': File exists

The directory already exists and there are other screens running.I think this is a server related error. Any help?

I am running CentOS 6.0 Final

TenTenths 01-26-2012 10:22 AM

Quote:

Originally Posted by h3llkill3r (Post 4584978)
PHP Code:

$name="CoD2-test";
$extra="+set net_port 28990 +set g_gametype sd +map mp_toujane";
$dir="/home/servers/cod2/War_Servers";
$exe="cod2_lnxded";

$exec=$dir."/".$exe;

echo 
shell_exec('cd '.$dir);
echo 
shell_exec('screen -d -m -S root '.$name.$exec.$extra); 


Are you sure you don't need spaces in your variables or where you concat them in the last line? As your code stands it'll execute

Code:

screen -d -m -S root CoD2-test/home/servers/cod2/War_Servers/cod2_lnxded+set net_port 28990 +set g_gametype sd +map mp_toujane
I'm guessing that you really want:
Code:

screen -d -m -S root CoD2-test /home/servers/cod2/War_Servers/cod2_lnxded +set net_port 28990 +set g_gametype sd +map mp_toujane

h3llkill3r 01-26-2012 10:36 AM

Quote:

Originally Posted by TenTenths (Post 4585003)
I'm guessing that you really want:
Code:

screen -d -m -S root CoD2-test /home/servers/cod2/War_Servers/cod2_lnxded +set net_port 28990 +set g_gametype sd +map mp_toujane

I tried it but gave me the same error


All times are GMT -5. The time now is 05:37 AM.