From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 16:09:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE5F9106564A; Mon, 6 Feb 2012 16:09:10 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 91FAF8FC19; Mon, 6 Feb 2012 16:09:10 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 4938446B0C; Mon, 6 Feb 2012 11:09:10 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id D091EB91E; Mon, 6 Feb 2012 11:09:09 -0500 (EST) From: John Baldwin To: Pawel Jakub Dawidek Date: Mon, 6 Feb 2012 10:25:42 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <1E1FA19C-7C4C-4288-B163-E33FC68D9837@palisadesystems.com> <20120206144337.GH1324@garage.freebsd.pl> In-Reply-To: <20120206144337.GH1324@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201202061025.42239.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 06 Feb 2012 11:09:09 -0500 (EST) Cc: src-committers@freebsd.org, Guy Helmer , svn-src-all@freebsd.org, Andrey Zonov , Mikolaj Golub , svn-src-head@freebsd.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 16:09:10 -0000 On Monday, February 06, 2012 9:43:39 am Pawel Jakub Dawidek wrote: > On Mon, Feb 06, 2012 at 08:31:47AM -0600, Guy Helmer wrote: > > If my understanding of flock(2) semantics is correct, with open(2) O_CLOEXEC or fcntl(2) FD_CLOEXEC set on the pidfile, the closing of the pidfile file descriptor during an exec will result in loss of the lock on the pidfile regardless of whether daemon(8) hangs around to wait for the child exit. > > My expectation is that as long as parent process holds pidfile > descriptor open and locked, the pidfile should remain locked even after > fork(2)/execve(2). Worth checking, though. Yes, if the daemon process hung around that would work. Note that I think you would need to do a double-fork for that to work though since users expect daemon to return instantly and not need to be put in the background. -- John Baldwin