From owner-freebsd-current@FreeBSD.ORG Mon Oct 19 11:30:14 2009 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85DC71065672 for ; Mon, 19 Oct 2009 11:30:14 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194]) by mx1.freebsd.org (Postfix) with ESMTP id B28A28FC20 for ; Mon, 19 Oct 2009 11:30:13 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id n9JBTcCA047207 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 19 Oct 2009 14:29:39 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id n9JBTciw048140; Mon, 19 Oct 2009 14:29:38 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id n9JBTcNY048139; Mon, 19 Oct 2009 14:29:38 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 19 Oct 2009 14:29:38 +0300 From: Kostik Belousov To: Dag-Erling Sm??rgrav Message-ID: <20091019112938.GT2160@deviant.kiev.zoral.com.ua> References: <20091018220935.GR2160@deviant.kiev.zoral.com.ua> <86my3n6d8k.fsf@ds4.des.no> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="s3R87C3fwYeCSZ0b" Content-Disposition: inline In-Reply-To: <86my3n6d8k.fsf@ds4.des.no> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Warren Block , current@freebsd.org Subject: Re: /etc/rc.d locking devd.pid X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 11:30:14 -0000 --s3R87C3fwYeCSZ0b Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 19, 2009 at 09:42:51AM +0200, Dag-Erling Sm??rgrav wrote: > Kostik Belousov writes: > > I think that this is a generic issue with pidfile/fork interaction. > > It is not obvious whether setting FD_CLOEXEC flag is right thing to > > do there. >=20 > Most certainly not. Why ? We definitely leak file descriptor on exec(2) unless daemon explicitely closes it after fork. I said that it is unobvious is it right to enforce FD_CLOEXEC unconditionally, because some daemons exec() itself to reinitialize. >=20 > > Anyway, please test. >=20 > Please read flopen.c's revision history. I am aware of flock->fcntl->flock story, but it is relevant to fork(2), not to the exec(2) issues. --s3R87C3fwYeCSZ0b Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkrcTaEACgkQC3+MBN1Mb4jdQACbBaBOLuqgoxy+MxpmckBHQ86r vtEAn3SROKpl4x3IXGef3UGQP0kN9wgh =yeVt -----END PGP SIGNATURE----- --s3R87C3fwYeCSZ0b--