Results 1 to 4 of 4

Thread: My problem with log of screen

  1. #1
    Private
    Join Date
    Feb 2016
    Posts
    13
    Thanks
    9
    Thanked 3 Times in 3 Posts

    Question My problem with log of screen

    Hello guys,
    I am trying to create a free cod2 hosting , currently i am working on a console for my clients, so i do

    PHP Code:
    screen ----S $user_id -L sh -'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 ^_^

  2. The Following User Says Thank You to lamakak For This Useful Post:

    kung foo man (19th April 2018)

  3. #2
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,010
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    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
    timescale 0.01

  4. The Following User Says Thank You to kung foo man For This Useful Post:

    lamakak (20th April 2018)

  5. #3
    Private
    Join Date
    Feb 2016
    Posts
    13
    Thanks
    9
    Thanked 3 Times in 3 Posts
    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

  6. #4
    Private
    Join Date
    Feb 2016
    Posts
    13
    Thanks
    9
    Thanked 3 Times in 3 Posts
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •