LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-26-2012, 09:51 AM   #1
h3llkill3r
LQ Newbie
 
Registered: Oct 2009
Distribution: CentOS, Debian, Ubuntu
Posts: 18

Rep: Reputation: 0
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

Last edited by h3llkill3r; 01-26-2012 at 10:01 AM.
 
Old 01-26-2012, 10:22 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Quote:
Originally Posted by h3llkill3r View Post
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
 
Old 01-26-2012, 10:36 AM   #3
h3llkill3r
LQ Newbie
 
Registered: Oct 2009
Distribution: CentOS, Debian, Ubuntu
Posts: 18

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by TenTenths View Post
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] make directory Pedroski Linux - General 4 09-19-2011 06:59 AM
How to make a sub directory to one directory..? mlibot Linux - Newbie 7 08-26-2009 08:44 AM
every live distro make make screen out of frequency clhona Linux - Hardware 2 02-14-2007 01:46 AM
Can I Make make Believe Root Is a Different Directory? binarybob0001 Linux - General 5 11-20-2006 03:33 AM
Which directory do I install Screen? lexington Linux - Software 5 04-03-2004 11:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration