>Number: 940 >Category: general >Synopsis: standalone mode does not close fds 0, 1 and 2 in detach(). >Confidential: no >Severity: non-critical >Priority: medium >Responsible: apache (Apache HTTP Project) >State: open >Class: sw-bug >Submitter-Id: apache >Arrival-Date: Wed Jul 30 08:30:01 1997 >Originator: [EMAIL PROTECTED] >Organization: apache >Release: 1.2.1 >Environment: BSD/OS 3.0 >Description: When Apache runs in standalone mode, it leaves file descriptors 0, 1 and 2 open. I noticed this problem when I was testing a script which stops and starts apache from cron. cron keeps waiting on a pipe (to get the output from the command) which is kept open because apache keeps these file descriptors open. I verified this with lsof(1).
I think daemon processes should always close fd's 0, 1 and 2. >How-To-Repeat: Use fstat, lsof or a similar program. >Fix: Add close(0); close(1); close(2); to the detach() function in http_main.c >Audit-Trail: >Unformatted:
