Another great way to start up your game server screens is to use these options:
"[EMAIL PROTECTED] screen -AmdS [Screen Name] ./srcds_run -console -game name etc" This will actually start the screen and automatically send it to the background as a daemon basically. : ) -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ferenc Kovacs Sent: Friday, December 05, 2008 8:49 PM To: Half-Life dedicated Linux server mailing list Subject: Re: [hlds_linux] rcon command linux On Fri, Dec 5, 2008 at 10:45 PM, David A. Parker <[EMAIL PROTECTED]> wrote: > This might work better: > > su - username -c "screen -r [screen name/pid]" > > - Dave > > Crazy Canucks wrote: > > The problem when you su -c "screen -r [screen name/pid]" [user] is that > > the screen is opening the tty of the user you are logged in as to > > display it's console. And unless it has permissions on the tty for the > > user you are logged in as, it can't do that. > > > > So you either have to change permissions on the current users tty, or > > log in as the user the screen is running under to access the screen. > > > > Drek > > > > bl4nk wrote: > >> Why? Can't he just do 'su steam' and then 'screen -r'? > >> > >> Crazy Canucks wrote: > >> > >>> Well if you do that, then you do need to change the permissions on the > >>> tty. That is what I do because my server is in my home, I am the sole > >>> user, ssh can only be accessed from my lan, etc. I use a small script > >>> to accomplish the task. I call it "steam_console" but obviously you > can > >>> call it whatever you wish. > >>> > >>> Mine is slightly different, but yours could look something like this: > >>> > >>> #!/bin/bash > >>> > >>> while [ -z "$user" ] > >>> do > >>> echo "Please enter the user your screen session is running under:" > >>> read user > >>> done > >>> > >>> echo "Here is a list of screen sessions avalable under that user name." > >>> su -c "screen -ls" $user > >>> > >>> while [ -z "$session_name" ] > >>> do > >>> echo "Please enter a screen session name from the above list:" > >>> read session_name > >>> done > >>> > >>> chmod 666 /dev/pts/* > >>> > >>> su -c "screen -r $session_name" $user > >>> > >>> chmod 620 /dev/pts/* > >>> > >>> exit 0 > >>> > >>> This script will change the permissions on the contents of pts to allow > >>> you to open a tty for the user your server is running under, then put > >>> the permissions back the way they should be after. Note that this is > on > >>> Debian Etch. I don't know if the contents of the pts folder are > >>> different on different distros, so you might want to check the contents > >>> before you run the script and adjust the permisson in the second to > last > >>> line accordingly. > >>> > >>> However, if your server is in a public space and others have access to > >>> it, you might not want to use this script. You would be better off > just > >>> to log in as the user that your screen session runs under and do it > that > >>> way. > >>> > >>> Drek > >>> > >>> Jonass wrote: > >>> > >>> > >>>> Thank you for your responses. > >>>> I run effectively srcds with screen. > >>>> But for me I connect like this: > >>>> - I log into my user with SSH > >>>> - I do "su steam" > >>>> - Then I run the screen > >>>> And in this case, I can not see the screen with "screen -r" due to a > >>>> problem with permissions. > >>>> > >>>> Jonass > >>>> > >>>> Mark - hlds list a écrit : > >>>> > >>>> > >>>> > >>>>> Glad you posted on that, I re-read his post two or three times trying > to > >>>>> figure out why on earth he was saying to change the permissions like > >>>>> that. There is no reason whatsoever to do it if all you're wanting > to > >>>>> do is resume your screen session as the user who started it in the > first > >>>>> place... so OP, _don't_ change the perms on pts, you'll be able to > >>>>> 'screen -r' just fine, believe me. > >>>>> > >>>>> > >>>>> Crazy Canucks wrote: > >>>>> > >>>>> > >>>>> > >>>>> > >>>>>> Last time I mentioned something like that, I was told changing the > >>>>>> permissions on your tty's was a bad idea. If you log in and access > your > >>>>>> console as the same user that you started the screen session under, > you > >>>>>> shouldn't need to do that. > >>>>>> > >>>>>> Drek > >>>>>> > >>>>>> X-GameServer | Alexander Nurevski wrote: > >>>>>> > >>>>>> > >>>>>> > >>>>>> > >>>>>> > >>>>>>> do you start the server in a screen ? > >>>>>>> > >>>>>>> If "yes" do this: > >>>>>>> > >>>>>>> as root > >>>>>>> chmod -R 777 /dev/pts > >>>>>>> > >>>>>>> then switch to the user your server is installed under > >>>>>>> su XXXXXXX > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>>> > >>>>> _______________________________________________ > >>>>> To unsubscribe, edit your list preferences, or view the list > archives, please visit: > >>>>> http://list.valvesoftware.com/mailman/listinfo/hlds_linux > >>>>> > >>>>> > >>>>> > >>>>> > >>>> _______________________________________________ > >>>> To unsubscribe, edit your list preferences, or view the list archives, > please visit: > >>>> http://list.valvesoftware.com/mailman/listinfo/hlds_linux > >>>> > >>>> > >>>> > >>> _______________________________________________ > >>> To unsubscribe, edit your list preferences, or view the list archives, > please visit: > >>> http://list.valvesoftware.com/mailman/listinfo/hlds_linux > >>> > >>> > >> > >> _______________________________________________ > >> To unsubscribe, edit your list preferences, or view the list archives, > please visit: > >> http://list.valvesoftware.com/mailman/listinfo/hlds_linux > >> > > > > > > _______________________________________________ > > To unsubscribe, edit your list preferences, or view the list archives, > please visit: > > http://list.valvesoftware.com/mailman/listinfo/hlds_linux > > -- > > Dave Parker > Utica College > Integrated Information Technology Services > (315) 792-3229 > Registered Linux User #408177 > > > _______________________________________________ > To unsubscribe, edit your list preferences, or view the list archives, > please visit: > http://list.valvesoftware.com/mailman/listinfo/hlds_linux > I wrote a simple wrapper around the hlds/srcds wich does the sudo part of the trick. and I simply log in with my own user (I added myself in the sudoers) and do something like this: screen -S cs_war ./myscript ctrl + a, d and anytime when I need to check or restart the server, I can reattach with: screen -x cs_war Tyrael _______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlds_linux CONFIDENTIALITY NOTICE: This e-mail may contain information that is privileged, confidential or otherwise protected from disclosure. If you are not the intended recipient of this e-mail, please notify the sender immediately by return e-mail, purge it and do not disseminate or copy it. _______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlds_linux