Results 1 to 3 of 3

Thread: My problem with log of screen

  1. #1
    Private
    Join Date
    Feb 2016
    Posts
    12
    Thanks
    7
    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
    1,875
    Thanks
    1,760
    Thanked 1,009 Times in 700 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
    12
    Thanks
    7
    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

Posting Permissions

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