From owner-freebsd-questions Mon Feb 10 13:16:31 2003 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 6234937B401 for ; Mon, 10 Feb 2003 13:16:29 -0800 (PST) Received: from ddba033.netstream.ch (ddba033.netstream.ch [62.65.128.33]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9237843F93 for ; Mon, 10 Feb 2003 13:16:28 -0800 (PST) (envelope-from mk@neon1.net) Received: from gw.adsl.ddn-ddn-131-202.netstream.ch ([80.238.131.202] helo=[192.168.0.199]) by ddba033.netstream.ch with esmtp (Exim 4.10) id 18iLHv-000Alf-00 for freebsd-questions@freebsd.org; Mon, 10 Feb 2003 22:16:27 +0100 User-Agent: Microsoft-Entourage/10.1.1.2418 Date: Mon, 10 Feb 2003 22:16:22 +0100 Subject: exec'ing ppp from within PHP From: Manuel Kasper To: Message-ID: Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit 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 Hi, I've run into a very strange problem: consider the following situation on a FreeBSD 4.7 system with custom /etc/rc* scripts: - system boots, /etc/rc is executed - /etc/rc executes a PHP script with a CLI version of PHP 4.3.0 - the PHP script uses exec() on a command like this: ppp -quiet -ddial test What happens is that at first, ppp runs fine - that is, until a certain amount of data has been transferred (about 5 MB). Then it dies without logging any messages. However, if I use the exact same command directly from within /etc/rc, ppp keeps working indefinitely without any problems - it will run for weeks and I can transfer gigabytes of data. I'm using ppp on a PPPoE connection (via netgraph). Sometimes also, when ppp has been exec'd by PHP, it immediately errors out, saying "no matching session" - that line obviously comes from netgraph's PPPoE module. Again, this only happens when exec'd from PHP - everything's OK from a shell script. I simply can't imagine what difference it makes whether ppp has been executed from PHP or from a shell script once it is running. And yes, I'm using > /dev/null 2>&1 in the exec() in PHP to make sure PHP won't wait for ppp - in fact PHP exits correctly after the exec, leaving ppp to run in the background. What puzzles me even more is that it doesn't work either when I use PHP to exec a shell script that in turn executes ppp. I checked to make sure that PHP doesn't set any ulimits that could get applied to the processes it creates - it sets none. I have cvsup'ed to 4.7-RELEASE-p4, made world, did everything to ensure that every single binary in the system was recompiled, tried it on another machine, but no such luck. Could somebody shed some light on this? Are there any other attributes similar to resource limits that can be inherited by child processes? Thanks! Manuel To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message