Author Topic: Redirecting/piping server stdout/stderr = blank  (Read 1059 times)

sk89q

  • Global Moderator
  • Autococker
  • Posts: 1049
Redirecting/piping server stdout/stderr = blank
« on: November 04, 2007, 12:38:34 AM »
Whenever I attempt to redirect (to a file) or pipe (to tee), Paintball's stdout and stderr are empty. If I don't redirect or pipe, it gets printed onto stdout with no issue. I am on FreeBSD.

Anyone have a clue?

KnacK

  • Global Moderator
  • Autococker
  • Posts: 3039
Re: Redirecting/piping server stdout/stderr = blank
« Reply #1 on: November 04, 2007, 07:01:42 AM »
what command are you usingto do this?
* KnacK is really curious about what you are working on......

sk89q

  • Global Moderator
  • Autococker
  • Posts: 1049
Re: Redirecting/piping server stdout/stderr = blank
« Reply #2 on: November 04, 2007, 12:32:08 PM »
Nothing special. My web RCON client tails a log file so I can read what happens in the game. I used to do this on my older RCON client when I was running on a different server, but ever since I moved to this server, I have been having this trouble.

Commands:
./paintball2 +set dedicated 1 +set public 1 +exec kaf_server_2.cfg +map midnight2 > test.log
./paintball2 +set dedicated 1 +set public 1 +exec kaf_server_2.cfg +map midnight2 >> test.log
./paintball2 +set dedicated 1 +set public 1 +exec kaf_server_2.cfg +map midnight2 2>&1 > test.log
./paintball2 +set dedicated 1 +set public 1 +exec kaf_server_2.cfg +map midnight2 &> test.log
./paintball2 +set dedicated 1 +set public 1 +exec kaf_server_2.cfg +map midnight2 | tee -a test.log

The regular stuff is outputted to the screen if I redirect stderr to a file:
./paintball2 +set dedicated 1 +set public 1 +exec kaf_server_2.cfg +map midnight2 2> test.log
Nothing is outputted to the screen if I redirect stdout to a file:
./paintball2 +set dedicated 1 +set public 1 +exec kaf_server_2.cfg +map midnight2 1> test.log

In addition, I whipped up a PHP script that opens the Paintball process and latches onto stdout. Still no output.

jitspoe

  • Administrator
  • Autococker
  • Posts: 18802
Re: Redirecting/piping server stdout/stderr = blank
« Reply #3 on: November 06, 2007, 02:39:34 PM »
Isn't that normal behavior?  If you're redirecting the output to a file, it isn't going to appear on the screen.  I'm not sure why this is necessary, though.  If you just set logfile 3 (should be that by default), it will log the console to qconsole<port#>.log.

sk89q

  • Global Moderator
  • Autococker
  • Posts: 1049
Re: Redirecting/piping server stdout/stderr = blank
« Reply #4 on: November 06, 2007, 03:57:52 PM »
Oh no, the file is blank too. 0 bytes.

I've managed to work around the problem by creating hard links to the qconsole files to where I need it, but that doesn't fix the problem. :|