From: roy at popmail.med.nyu.edu (Roy Smith) Date: Wed, 14 Apr 1999 11:28:18 -0400 Subject: forking + stdout = confusion References: <87n20caldg.fsf@spock.localnet.de> Message-ID: X-UID: 314 clarence at silcom.com (Clarence Gardner) wrote: > That does indeed do the trick, but you probably had to os.close(2) also. > (Both stdout and stderr normally are piped into Apache.) I don't know how all Apaches work, but at least on our machine, cgis get pipes for stdin and stdout, but stderr is connected directly to the error log file. I wrote a little test cgi which is just: > #!/bin/sh > sleep 300 opened http://my.host.name/cgi-bin/roy/sleeper.cgi and ran lsof, which is a neat utility which mucks about in the kernel's file tables and shows you what files a process has open. I got: COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME sleep 25247 nobody 0r FIFO 0x04a6ff00 0 22787 sleep 25247 nobody 1w FIFO 0x04096e00 0 22788 sleep 25247 nobody 2w VREG 3049,395040 4420204 90 /www/logs/error_log -- Roy Smith New York University School of Medicine