Bug #16548 Updated: exec or system a daemon will catch the port for this session

From: Date: Fri, 12 Apr 2002 09:26:27 +0000
Subject: Bug #16548 Updated: exec or system a daemon will catch the port for this session
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-4726@lists.php.net to get a copy of this message
ID: 16548 Updated by: wez@php.net Reported By: stefan.marquardt@hagebau.de -Status: Open +Status: Bogus Bug Type: Apache related Operating System: RED HAT Linux 7.2 PHP Version: 4.1.2 New Comment: Most likely _mprshut is forking but keeping some fd's open, or doing something else strange. I can't see how this is PHP's fault (it just uses popen), so I'm marking this as bogus. As a workaround, don't use exec :-) Previous Comments: ------------------------------------------------------------------------ [2002-04-12 02:06:33] stefan.marquardt@hagebau.de The same with: system("exec $DLC/bin/_mprshut $CADB/$DB -C watchdog 2>&1 </dev/null"); This _mprshut needs no input. (I mail this problem also to the developer of _mprshut,Progress Database.) The rest of the php script finishes but i can't open a new page and have to close this session. In the moment i have no further idea to separate this command from the actual www session. I tried "at", that works but +1 minute is too late. :-( ------------------------------------------------------------------------ [2002-04-11 11:55:05] wez@php.net Try this: system("exec $DLC/bin/_mprshut $CADB/$DB -C watchdog 2>&1 </dev/null"); ------------------------------------------------------------------------ [2002-04-11 11:46:40] stefan.marquardt@hagebau.de Hi, system("exec $DLC/bin/_mprshut $CADB/$DB -C watchdog 1>/dev/null 2>&1 &"); has the same effect! _mprshut is a daemon that ended in a second. Please notice: The script doesn't hungs the rest works fine after system. I can't open any new page after accessing this script an _mprshut listen on port 80. On HP-UX the Apache still works fine with a listening _mprshut. Stefan ------------------------------------------------------------------------ [2002-04-11 11:37:33] wez@php.net Hmm, on second thoughts, it sounds like your OS is broken. Does the equivalent script written in perl do the same? ------------------------------------------------------------------------ [2002-04-11 11:35:10] wez@php.net Please read the docs about system(). System executes the process and waits for it to complete before returning. You need to append an & character to your command to cause it to run in the background. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/16548 -- Edit this bug report at http://bugs.php.net/?id=16548&edit=1

« previous php.bugs (#4726) next »