LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-27-2005, 06:05 PM   #1
jetpig
LQ Newbie
 
Registered: Oct 2005
Posts: 20

Rep: Reputation: 0
problems with screen.


so here's my scenario.

I've got a dedicated server running slackware 10.2 that will be serving day of defeat source.

there are 3 users with shell access and i would like to use screen to allow each of them to retrieve the console at various times.

I figured making a script that would launch the server (using screen) as a 4th user using sudo (i know the other 2 users with shell access personally) and another script using that 4th user to retrieve the server would help fix this (script follows

to launch the server:

echo "Starting DOD:Source Server"
sleep 1
sudo -u source screen -A -m -d -S dod ./srcds_run -console -game dod
exit

to retrieve it:

echo "Retrieving Server"
sleep 1
sudo -u source screen -x dod
exit


So my current problem is this error:

You are not the owner of /home/jetpig/.screen.

the server and scripts are located in /home/source/srcds_1/
i'm launching as the user jetpig and am executing the scripts while in the srcds_1 folder.


Any help will be greatly appreciated.



thanks in advance!
 
Old 10-27-2005, 06:47 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
The only thing I can think of is that you created /home/jetpig/.screen as root. Therefore, you are not the owner.

Check the ownership: ls -l /home/jetpig/.screen. If jetpig isn't the owner, you will have to su, or sudo, to root, then use the chown command to change ownership.
 
Old 10-27-2005, 06:51 PM   #3
jetpig
LQ Newbie
 
Registered: Oct 2005
Posts: 20

Original Poster
Rep: Reputation: 0
that returns:

"total 0"
 
Old 10-27-2005, 06:57 PM   #4
jetpig
LQ Newbie
 
Registered: Oct 2005
Posts: 20

Original Poster
Rep: Reputation: 0
what's odd is that screen is giving that error when there's nothing in that folder and the user source is trying to run it.
 
Old 10-28-2005, 06:03 AM   #5
Dtsazza
Member
 
Registered: Oct 2005
Location: Oxford, UK
Distribution: Debian Etch (w/ dual-boot XP for gaming)
Posts: 282

Rep: Reputation: 31
Quote:
Originally posted by jetpig
that returns:

"total 0"
It sounds like it's finding the file (since it doesn't say "No such file or directory"), but since it's a hidden file it's not displaying it. Try again, adding the -a switch i.e. 'ls -al /home/jetpig/.screen'.
 
Old 10-28-2005, 12:41 PM   #6
jetpig
LQ Newbie
 
Registered: Oct 2005
Posts: 20

Original Poster
Rep: Reputation: 0
that returns:

total 1
drwxrwxrwx 2 source users 48 2003-07-05 19:10 ./
drwxrwxrwx 4 jetpig users 160 2003-07-05 15:03 ./

(that's something else.... time won't stay set across reboots)
 
Old 10-28-2005, 02:26 PM   #7
Dtsazza
Member
 
Registered: Oct 2005
Location: Oxford, UK
Distribution: Debian Etch (w/ dual-boot XP for gaming)
Posts: 282

Rep: Reputation: 31
I found your problem (probably), while playing around with sudo trying to make a script that returns the user it's running under, and thought it was strange that the sudo 'lasted' until the end of the line, whereas similar things like su -c didn't.

Of course, I was wrong (I've never used sudo, personally) and it turns out that sudo acts for one character. Try wrapping your commands in quote marks, like so:
Code:
echo "Starting DOD:Source Server"
sleep 1
sudo -u source "screen -A -m -d -S dod ./srcds_run -console -game dod"
exit
and
Code:
echo "Retrieving Server"
sleep 1
sudo -u source "screen -x dod"
exit
(And I had a really fancy script ready too, based around the fact that whoami "doesn't work under sudo", which of course it does if wrapped in quotes properly )
 
Old 10-28-2005, 04:09 PM   #8
jetpig
LQ Newbie
 
Registered: Oct 2005
Posts: 20

Original Poster
Rep: Reputation: 0
now this is odd.... "sudo: screen -A -m -d -S dod ./srcds_run -game dod ... (trails off with a ton of other launch options) ... +autoupdate: command not found"

i tried explicitly telling it wghere srcds_run was also. it seems that it doesn't like the screen command though.... i tried running it straight from the source user and it worked fine
 
Old 10-29-2005, 05:12 AM   #9
Dtsazza
Member
 
Registered: Oct 2005
Location: Oxford, UK
Distribution: Debian Etch (w/ dual-boot XP for gaming)
Posts: 282

Rep: Reputation: 31
It's the 'screen' command that it's trying to run, all the other words are just arguments to that command. I must admit, I'm not really sure where the problem lies here, but you could try
Code:
$ which screen
while logged in as both jetpig and source to check that they both have the executable in their path - and a final paranoid
Code:
$ sudo -u source "which screen"
just to make sure that sudo isn't messing it up. If they all locate the command fine... then you could try explicitly adding the full path to the screen commands in your script.

It's got to be something fairly simple, with an error like "command not found"...
 
Old 10-29-2005, 01:31 PM   #10
jetpig
LQ Newbie
 
Registered: Oct 2005
Posts: 20

Original Poster
Rep: Reputation: 0
i get /usr/bin/screen for jetpig and i get sudo: which screen: command not found. i took out the quotes and it works fine... *sigh* like you said, something simple.


ok well the launch script works. now i can't retrieve it. both as user jetpig and source i'm told that there is no screen to be attaced matching dod.

if i try sudo -u source screen -x dod i get Cannot open your terminal "/dev/pts0/0' - please check.

is it possible it thinks i'm not a vt100 terminal?

Last edited by jetpig; 10-29-2005 at 01:39 PM.
 
Old 10-30-2005, 12:35 PM   #11
jetpig
LQ Newbie
 
Registered: Oct 2005
Posts: 20

Original Poster
Rep: Reputation: 0
*bump*
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Screen problems Elim Linux - General 1 09-21-2004 07:39 PM
Screen problems gonzalo76 Slackware 4 05-05-2004 11:15 AM
Still having screen resolution problems. Chu Linux - Newbie 3 11-21-2003 04:05 AM
Screen Problems Silence95 Mandriva 2 08-31-2003 06:51 AM
Screen and other problems. bakuretsu Linux - Software 1 08-02-2002 10:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:54 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