Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:13938 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91405 invoked by uid 1010); 23 Nov 2004 19:56:03 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 91347 invoked from network); 23 Nov 2004 19:56:03 -0000 Received: from unknown (HELO rproxy.gmail.com) (64.233.170.194) by pb1.pair.com with SMTP; 23 Nov 2004 19:56:03 -0000 Received: by rproxy.gmail.com with SMTP id q1so11858rnf for ; Tue, 23 Nov 2004 11:56:03 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=VEkpx39swebUbQbY0Yi9X5ZOt+S0GU5d9puqvTQnru7q4HjwjZgVPfTW55qEWwtL69XItkDP4uH4CYdzMn58QFCRbpqKWnjUMAZMEMHMJJ9sqYfACy70PbPi2z2wX9OdxovxDspFvHmlIhO03qLa0Iw5k0aA899UX72s6Sq3Ffo= Received: by 10.38.163.5 with SMTP id l5mr284739rne; Tue, 23 Nov 2004 11:56:02 -0800 (PST) Received: by 10.38.70.50 with HTTP; Tue, 23 Nov 2004 11:56:02 -0800 (PST) Message-ID: Date: Tue, 23 Nov 2004 21:56:02 +0200 Reply-To: "ilya77@gmail.com" To: Wez Furlong Cc: Jed Smith , internals@lists.php.net In-Reply-To: <4e89b4260411222252788e7d18@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <90e24d4e041122003850705ce8@mail.gmail.com> <20041123023030.33740.qmail@pb1.pair.com> <4e89b4260411222252788e7d18@mail.gmail.com> Subject: Re: [PHP-DEV] creating detached processes in PHP From: ilya77@gmail.com ("ilya77@gmail.com") win32: copy the code from proc_open(), just leave the pipes stuff out. By detached I mean - start and leave running. for most unixes: pid = fork(); if (pid == 0) { close(0); close(1); close(2); // mask out SIGHUP signal - unfortunately I don't remember the calls for unixes exec(...); } else if (pid == -1) { // fail return -1; } else { return pid; } On Tue, 23 Nov 2004 01:52:41 -0500, Wez Furlong wrote: > On Tue, 23 Nov 2004 08:28:03 +0200, ilya77@gmail.com wrote: > > The bottom line, is that in PHP there is no simple and consistent > > cross-platform way to create a detached child process. > > > Being a system programmer, this shouldn't be too much of an obstacle > > for me, but at this moment I'm thinking of the application programmers > > which don't have an api to create detach processes. > > Define what you mean by detached and provide an example (in C) of how > to achieve it on all (well, most will do) unices without assuming the > presence of utility apps like nohup. > > Likewise for win32. > > --Wez. >