Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:52094 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50021 invoked from network); 30 Apr 2011 12:54:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Apr 2011 12:54:23 -0000 Authentication-Results: pb1.pair.com smtp.mail=h.reindl@thelounge.net; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=h.reindl@thelounge.net; sender-id=pass Received-SPF: pass (pb1.pair.com: domain thelounge.net designates 91.118.73.15 as permitted sender) X-PHP-List-Original-Sender: h.reindl@thelounge.net X-Host-Fingerprint: 91.118.73.15 mail.thelounge.net Windows 98 (1) Received: from [91.118.73.15] ([91.118.73.15:51761] helo=mail.thelounge.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F6/F5-10915-C760CBD4 for ; Sat, 30 Apr 2011 08:54:21 -0400 Received: from srv-rhsoft.rhsoft.net (openvpn-241.thelounge.net [10.0.0.241]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.thelounge.net (Postfix) with ESMTPSA id ACB5E97 for ; Sat, 30 Apr 2011 14:54:17 +0200 (CEST) Message-ID: <4DBC0679.6080400@thelounge.net> Date: Sat, 30 Apr 2011 14:54:17 +0200 Organization: the lounge interactive design User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b3pre Thunderbird/3.1.10 MIME-Version: 1.0 To: internals@lists.php.net References: In-Reply-To: X-Enigmail-Version: 1.1.2 OpenPGP: id=7F780279; url=http://arrakis.thelounge.net/gpg/h.reindl_thelounge.net.pub.txt Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig8110ABC90A1A95DB97339D27" Subject: Re: [PHP-DEV] adding low level file handling stuff From: h.reindl@thelounge.net (Reindl Harald) --------------enig8110ABC90A1A95DB97339D27 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Am 30.04.2011 14:04, schrieb Ferenc Kovacs: > Hi. >=20 > recently I found a nice blogpost about how to properly daemonize a php > daemon: > http://andytson.com/blog/2010/05/daemonising-a-php-cli-script-on-a-posi= x-system/ > I've noticed in this article, that you can replace/redirect the > STDIN/STDOUT/STDERR from inside of your script, you have to close them,= and > open in the correct order. > It works (at least on linux), because the opened files will have the 1,= 2,3 > FDs, because the OS assign the lowest available FD, which will happen t= o be > the required ones the cleaner way is to do this in a /etc/init.d/service-script we are running a monitoring-service written in php wilh a while(1=3D=3D1)= as linux-daemon since years and even config-changes are no problem with an internal counter for reloading them every 10 while-runs sleep(1) is a good idea fpr each run to make sure the daemon eats not too= much ressources useless --------------enig8110ABC90A1A95DB97339D27 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ iEYEARECAAYFAk28BnkACgkQhmBjz394AnkteACeNlvvVKY2lkGDe2CRrk/yodfW 8ioAn1CGVt6m8MrhMhJSOfDxAqzBJ6dx =upcD -----END PGP SIGNATURE----- --------------enig8110ABC90A1A95DB97339D27--