[cod] Screen and su question.

Steven Hartland killing at multiplay.co.uk
Wed Jan 12 07:02:23 EST 2005


You didnt give it a command to execute so it quit instantly
su - coduo -c "screen -d -m COMMAND"
  ----- Original Message ----- 
  From: yuk 
  To: cod at icculus.org 
  Sent: Wednesday, January 12, 2005 9:44 AM
  Subject: RE: [cod] Screen and su question.


  Hi all,

   

  Jay, I did not delete the user.. Honest ;) 

   

  The problem is indeed as Steven described, the screen program is executed from the terminal which is owned by the user Yuk. Then, because I do a su - coduo -c screen the screen command is executed from the coduo user, however there is no terminal created for the coduo user when you use su - coduo -c screen. Then, loggin in as the coduo user, I do see the screen command using screen -ls, but I cannot connect to it because the terminal is owned by yuk, not coduo.

   

  Steven, as for you advice to use the screen -d -m option, still that does not work.

   

  I do in terminal 5

   

  [yuk at yoda yuk]$ su - coduo -c "screen -d -m"

  Password:

  [yuk at yoda yuk]$ screen -ls

  No Sockets found in /tmp/uscreens/S-yuk.

   

  [yuk at yoda yuk]$

  [yuk at yoda yuk]$ ls -al /dev/pts

  totaal 148

  drwxr-xr-x   2 root  root      0 jan 12  2005 .

  drwxr-xr-x  25 root  root 147456 jan 12 10:33 ..

  crw--w----   1 cod   tty  136, 0 jan 12 10:40 0

  crw--w----   1 coduo tty  136, 1 jan 12 10:40 1

  crw--w----   1 root  tty  136, 2 jan 12 10:34 2

  crw--w----   1 root  tty  136, 3 jan 12 10:40 3

  crw--w----   1 yuk   tty  136, 4 jan 12 10:40 4

  crw--w----   1 yuk   tty  136, 5 jan 12 10:41 5

  crw--w----   1 coduo tty  136, 6 jan 12 10:40 6

  [yuk at yoda yuk]$ tty

  /dev/pts/5

  [yuk at yoda yuk]$

   

   

  And in terminal 4 ( different telnet session ! )

   

  [yuk at yoda yuk]$ su - coduo

  Password:

  [coduo at yoda coduo]$ screen -ls

  There are screens on:

          4701..yoda      (Detached)

  1 Sockets in /tmp/uscreens/S-coduo.

   

  [coduo at yoda coduo]$ screen -r 4701..yoda

  Cannot open your terminal '/dev/pts/4' - please check.

  [coduo at yoda coduo]$ tty

  /dev/pts/4

  [coduo at yoda coduo]$ ls -al /dev/pts

  totaal 148

  drwxr-xr-x   2 root  root      0 jan 12  2005 .

  drwxr-xr-x  25 root  root 147456 jan 12 10:33 ..

  crw--w----   1 cod   tty  136, 0 jan 12 10:40 0

  crw--w----   1 coduo tty  136, 1 jan 12 10:40 1

  crw--w----   1 root  tty  136, 2 jan 12 10:34 2

  crw--w----   1 root  tty  136, 3 jan 12 10:40 3

  crw--w----   1 yuk   tty  136, 4 jan 12 10:42 4

  crw--w----   1 yuk   tty  136, 5 jan 12 10:41 5

  crw--w----   1 coduo tty  136, 6 jan 12 10:40 6

  [coduo at yoda coduo]$

   

  The initial thought behind this was to have a script run on boot of the machine to start my coduo server but that server process should be owned by coduo not root.

   

  I think you script would be more usefull, except for the fact that there is no way of executing commands on the server in the console if you do not use screen. In otherwords, without using some sort of remote admin tool to admin the coduo server you can only start and stop it. Sometimes you want to say, change the map or kick some user from your server and the most easy way to do that with all Q3 engine based servers it on the command line in the game server console.

  That is the only reason I use this screen tool. 

   

  Jay, what kind of script/command do you use to start your coduo servers ? Do you login as the user who will own the coduo server ? Or do you use su - to switch to that user .. I know you use screen as well, as many other members of this mailing list, but maybe if some of you provided their approach I could figure out the best way to go.

   

  Thanx for the help so far.

   

  Kind regards,

  Yuk.


------------------------------------------------------------------------------

  Van: Jay Vasallo [mailto:jayco1 at charter.net] 
  Verzonden: woensdag 12 januari 2005 4:14
  Aan: cod at icculus.org
  Onderwerp: Re: [cod] Screen and su question.

   

  I understand what they are. It just looked as if he was trying to get it started. Then removed the user while he had screens with the user. Then re-added the user and then he tried to connect to them. I have done this in the past and always had permission errors. This is why i suggested deleting them and starting the server again.

    ----- Original Message ----- 

    From: Steven Hartland 

    To: cod at icculus.org 

    Sent: Tuesday, January 11, 2005 8:56 PM

    Subject: Re: [cod] Screen and su question.

     

    I don't think you quite understand what pts's are. They are "sudo" files

    they there are more like devices than files. They are created dynamically

    when you login.

    So sshing in as yuk will create a "terminal" pty owned by said user.

    This is that sessions "screen" to all intensive purposes. When you logout

    it will be "deleted".

     

    There is no problem starting the game processes under screen using

    the coduo user. The problem he's seeing is that if said screen is

    created in the foreground it instantly tries to write to the "terminal"

    as that device is only accessible to the yuk user this fails.

     

    The solution as I said is to start them using -d -m which never tries to

    open the "terminal". If you then subsequently want to view the screen

    and you logged in as another user and su'ed, just temporally grant

    that user access to that sessions "terminal" with chmod e.g.

    chown coduo /dev/pts/6

     

        Steve / K

      ----- Original Message ----- 

      From: Jay Vasallo 

      To: cod at icculus.org 

      Sent: Wednesday, January 12, 2005 12:44 AM

      Subject: Re: [cod] Screen and su question.

       

      Well he shows two users. 

       

      Using username "yuk".

      Authenticating with public key "imported-openssh-key" from agent

      [yuk at yoda yuk]$ su -

      Password:

      [root at yoda root]# su - coduo -c screen

      Cannot open your terminal '/dev/pts/6' - please check.

      [root at yoda root]# ls -la /dev/pts

      totaal 148

      drwxr-xr-x   2 root root      0 jan 11  2005 .

      drwxr-xr-x  25 root root 147456 jan 11 22:22 ..

      crw--w----   1 cod  tty  136, 0 jan 11 22:58 0

      crw--w----   1 yuk  tty  136, 1 jan 11 22:59 1

      crw--w----   1 root tty  136, 2 jan 11 22:53 2

      crw--w----   1 yuk  tty  136, 3 jan 11 22:59 3

      crw-------   1 yuk  tty  136, 4 jan 11 22:59 4

      crw--w----   1 yuk  tty  136, 5 jan 11 23:00 5

      crw--w----   1 yuk  tty  136, 6 jan 11 23:00 6

      [root at yoda root]# tty

      /dev/pts/6

       

       

      He is probably the one using them all with this script of his. If he is the only one..I say delete them and start over. Screw trying to figure out why one user can't use the other one. Have the same user start the same screen. Looks like he did a "userdel" while he had open screens. I have done this myself...so I say delete them, start his server. But of course everyone wants to make a science project out of starting a simple coduo server.

        ----- Original Message ----- 

        From: Steven Hartland 

        To: cod at icculus.org 

        Sent: Tuesday, January 11, 2005 6:29 PM

        Subject: Re: [cod] Screen and su question.

         

        LOL

        Erm dont delete them /me slaps Jay around with some skills :P

         

        They are owned by a different user as that's the user u logged in as.

         

        Your "terminal" is always owned by the user u log in as. This is to prevent

        other people reading your "screen".

        What I suspect u really want to do is to create a server under screen

        to do this use -m -d e.g.

        su - coduo -c "screen -m -d <server command>"

         

        Now if u want to login like u have and reconnect to see whats happening

        you will need to give said user access to your "terminal". To do this

        just use chown or chmod. Once your done dont forget to either:

        1. undo the permission changes

        2. logout totally and then reconnect ( u get a new "terminal" ).

         

            Steve / K

         

        ----- Original Message ----- 

          From: Jay Vasallo 

          To: cod at icculus.org 

          Sent: Tuesday, January 11, 2005 10:56 PM

          Subject: Re: [cod] Screen and su question.

           

          Delete them and start again.

            ----- Original Message ----- 

            From: yuk 

            To: cod at icculus.org 

            Sent: Tuesday, January 11, 2005 4:03 PM

            Subject: [cod] Screen and su question.

             

            Hi Guys,

             

            With great joy I have read all the posts in this lists and most of the information is very valuable! Thank you all for that.

             

            Now, the time has come that I need some help. 

             

            I want to use screen to monitor my server and have created a script to start it. However, I have a problem with screen which I do not know how to solve. It's probably something trivial, but my UNIX knowledge is not so great yet so I am quite stuck. Below is a snip let of what I wanted to do and does not work.

             

             

            Using username "yuk".

            Authenticating with public key "imported-openssh-key" from agent

            [yuk at yoda yuk]$ su -

            Password:

            [root at yoda root]# su - coduo -c screen

            Cannot open your terminal '/dev/pts/6' - please check.

            [root at yoda root]# ls -la /dev/pts

            totaal 148

            drwxr-xr-x   2 root root      0 jan 11  2005 .

            drwxr-xr-x  25 root root 147456 jan 11 22:22 ..

            crw--w----   1 cod  tty  136, 0 jan 11 22:58 0

            crw--w----   1 yuk  tty  136, 1 jan 11 22:59 1

            crw--w----   1 root tty  136, 2 jan 11 22:53 2

            crw--w----   1 yuk  tty  136, 3 jan 11 22:59 3

            crw-------   1 yuk  tty  136, 4 jan 11 22:59 4

            crw--w----   1 yuk  tty  136, 5 jan 11 23:00 5

            crw--w----   1 yuk  tty  136, 6 jan 11 23:00 6

            [root at yoda root]# tty

            /dev/pts/6

             

             

            In bold, you can see that the screen command fails because it cannot open the /dev/pts/6 pseudo terminal. That is correct because that terminal is owned by the user YUK not the user CODUO which I have su'ed to before calling screen.

             

            If anyone can help me out I would really appreciate it.

             

            Kind regards,

            Yuk.


        ================================================
        This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. 

        In the event of misdirection, illegible or incomplete transmission please telephone (023) 8024 3137
        or return the E.mail to postmaster at multiplay.co.uk. 


    ================================================
    This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. 

    In the event of misdirection, illegible or incomplete transmission please telephone (023) 8024 3137
    or return the E.mail to postmaster at multiplay.co.uk. 


================================================
This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. 

In the event of misdirection, illegible or incomplete transmission please telephone (023) 8024 3137
or return the E.mail to postmaster at multiplay.co.uk.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://icculus.org/pipermail/cod/attachments/20050112/7df4153e/attachment.htm>


More information about the Cod mailing list