From owner-freebsd-questions Sat Nov 23 22:41:52 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 09D9437B401 for ; Sat, 23 Nov 2002 22:41:51 -0800 (PST) Received: from smtp.comcast.net (smtp.comcast.net [24.153.64.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 91ED043EA9 for ; Sat, 23 Nov 2002 22:41:50 -0800 (PST) (envelope-from jld123@pobox.com) Received: from lee (pcp826719pcs.nrockv01.md.comcast.net [68.50.140.34]) by mtaout05.icomcast.net (iPlanet Messaging Server 5.1 HotFix 1.5 (built Sep 23 2002)) with SMTP id <0H6200GFDILPBX@mtaout05.icomcast.net> for freebsd-questions@freebsd.org; Sun, 24 Nov 2002 01:41:50 -0500 (EST) Date: Sun, 24 Nov 2002 01:46:48 -0500 From: Lee Nelson Subject: Apache not killing subprocesses, only on FreeBSD To: freebsd-questions@freebsd.org Message-id: MIME-version: 1.0 X-Mailer: Opera 6.05 build 1140 Content-type: text/plain; charset=windows-1252 Content-transfer-encoding: 7BIT X-Priority: 3 (Normal) Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hello, I run an database backed website on FreeBSD 4.5 that uses mod_perl. I do things like: open SORTER, "|/some/path/to/myprogram.pl"; system ("/usr/bin/zip zipfile.zip somefile"); When I switched to FreeBSD from Linux, I noticed that a lot of dead shells accumulated in the process list - sometimes hundreds. When I restart Apache they all go away. Linux didn't exhibit this behaviour. Can anyone tell me what I'm doing wrong? It's embarrassing to have to restart apache every few weeks. :-) The programs that are started all terminate normally, but the shell sticks around forever. The ps -aux looks like this: USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND ... nobody 2196 0.0 0.0 0 0 ?? Z Thu11AM 0:00.00 (sh) ... myprogram.pl reads a few parameters from STDIN, and then forks to work in the background: my $pid = fork; exit if $pid; die ("$pn couldn't fork $!\n") unless defined $pid; POSIX::setsid() or die ("$pn can't start a new session: $!\n"); Any clues or suggestions welcome. Thanks, Lee Nelson To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message