Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:46508 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92512 invoked from network); 23 Dec 2009 17:21:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Dec 2009 17:21:29 -0000 Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lerdorf.com from 209.85.210.192 cause and error) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 209.85.210.192 mail-yx0-f192.google.com Received: from [209.85.210.192] ([209.85.210.192:48081] helo=mail-yx0-f192.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AA/42-17066-891523B4 for ; Wed, 23 Dec 2009 12:21:29 -0500 Received: by yxe30 with SMTP id 30so8404561yxe.29 for ; Wed, 23 Dec 2009 09:21:26 -0800 (PST) Received: by 10.151.1.4 with SMTP id d4mr2388023ybi.265.1261588884495; Wed, 23 Dec 2009 09:21:24 -0800 (PST) Received: from ?192.168.200.22? (c-98-234-184-167.hsd1.ca.comcast.net [98.234.184.167]) by mx.google.com with ESMTPS id 4sm3312705yxd.16.2009.12.23.09.21.23 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 23 Dec 2009 09:21:23 -0800 (PST) Message-ID: <4B325191.6020102@lerdorf.com> Date: Wed, 23 Dec 2009 09:21:21 -0800 User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: RQuadling@googlemail.com CC: PHP Developers Mailing List References: <4B31D462.9080507@lerdorf.com> <10845a340912230623o42fbcc7eqbeb354392917fd03@mail.gmail.com> In-Reply-To: <10845a340912230623o42fbcc7eqbeb354392917fd03@mail.gmail.com> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] ignore_user_abort=true for sapi/cli From: rasmus@lerdorf.com (Rasmus Lerdorf) Richard Quadling wrote: > 2009/12/23 Rasmus Lerdorf : >> Can anyone think of a situation where you actually want our current >> ignore_user_abort=false setting for the cli sapi? > > I would say that the default setting is pretty important as pressing > CTRL+C (at least on windows) is the quickest way of killing a PHP cli > based script without killing the shell/console or loading the task > manager (or similar), finding the right instance of PHP and then > killing it. Again, ignore_user_abort has no effect on signal handling. A SIGTERM is going to kill the process regardless of the ignore_user_abort setting. ignore_user_abort is a simple boolean that guides whether to abort when PHP is unable to write to whatever output mechanism the sapi uses. For cli that would be stdout. If for some reason your cli script's tty goes away without the script being terminated then your script will die the next time it tries to write anything because ignore_user_abort is off by default. One situation where this is likely is when you specifically background and nohup your cli script. Right now unless you also set ignore_user_abort to true in your script, it will die on any sort of output. There are other cases as well. -Rasmus