PDA

View Full Version : My problem with log of screen



lamakak
19th April 2018, 09:25
Hello guys,
I am trying to create a free cod2 hosting , currently i am working on a console for my clients, so i do


screen -A -m -d -S $user_id -L sh -c 'cd cod2 && ./cod2_lnxded +set net_port $konecnyport +set rcon_password $rcon +set sv_hostname $hostname powered by FreeWarHosting +set rcon_password $rcon +set g_password $password +set dedicated 2 +exec server.cfg +set g_gametype sd +map_rotate +set sv_punkbuster 1 +map mp_toujane'

While i am running the server for client, all is fine but the output for my log is by default - screenlog.0 , so i copy that file to my website and then i read the file and i use it to print it as a console and all works, but the problem happens when there are more than 1 clients because every log is basically screenlog.0 and then all clients have the same output :/

I tried to google and i found on google things like you can use -logfile NAMEOFFILE and that would be the solution but my debian says that it doesn'T know this option , when i look in screen --help then i don't see any options for custom logging file just -L which does this what i said.

So i would like to ask is there any other solution to output the console? Thanks ^_^

kung foo man
19th April 2018, 09:55
Every cod2 server instance should have its own linux user account, so you can read the log file from each different user home dir, this would resolve the name conflict probably

But the last time I did this I wasn't happy with the capabilities of stone age C tools, so I wrote a Python script which opened a lnxded instance for each user, which then would accept WebSocket connections (user/password protected). So via webinterface a user could enter all kinds of commands and read back the result "in realtime". Multiple users are no problem aswell, you would just accept input from every WebSocket connection and send the output to each connected WebSocket client

Might sound a bit complex, but WebSocket and process read/write libraries and Web dev are so easy nowadays, you might finish that in a weekend

lamakak
20th April 2018, 17:08
Thanks for replying me ,

Well idk if it's good for each user what register is good to make him a linux account because it's a type of hosting where he get deleted his server every 60 minutes since it's free but might be option too , later i'll check the Websockets and i'll try to do it somehow and i'll post here what i tried or if it worked or no. Also i found that -c option overides default setting file and when you use custom you may write there log file name and it will log there i'll try this first if i won't succeed then i'll try it and will let you know what it fixed :)

lamakak
5th June 2018, 12:56
So after a while when i finished some other things i had to get back to this problem , so i'Ve found that the version of screen 4.06.02 - have the logfile , so i tried apt-get update , upgrade then i've realised that it updated to really older one, so i had manually download the newer and that solved my solution so i can use the -L logfile $variable.txt for example. Anyways thanks for answers :)