From owner-svn-src-all@FreeBSD.ORG Sat Feb 4 08:24:01 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 56C12106564A; Sat, 4 Feb 2012 08:24:01 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id A6BBF8FC0C; Sat, 4 Feb 2012 08:23:59 +0000 (UTC) Received: by bkbzx1 with SMTP id zx1so5002066bkb.13 for ; Sat, 04 Feb 2012 00:23:58 -0800 (PST) Received: by 10.204.143.131 with SMTP id v3mr4900132bku.44.1328343838654; Sat, 04 Feb 2012 00:23:58 -0800 (PST) Received: from [10.254.254.77] (ppp95-165-147-239.pppoe.spdop.ru. [95.165.147.239]) by mx.google.com with ESMTPS id cg2sm24123022bkb.12.2012.02.04.00.23.57 (version=SSLv3 cipher=OTHER); Sat, 04 Feb 2012 00:23:58 -0800 (PST) Message-ID: <4F2CEB1D.10607@zonov.org> Date: Sat, 04 Feb 2012 12:23:57 +0400 From: Andrey Zonov User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.8.1.24) Gecko/20100228 Thunderbird/2.0.0.24 Mnenhy/0.7.6.0 MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> In-Reply-To: <20120204074201.GA1694@garage.freebsd.pl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Guy Helmer 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: Sat, 04 Feb 2012 08:24:01 -0000 On 04.02.2012 11:42, Pawel Jakub Dawidek wrote: > On Wed, Feb 01, 2012 at 04:41:00PM +0000, Guy Helmer wrote: >> Author: ghelmer >> Date: Wed Feb 1 16:40:59 2012 >> New Revision: 230869 >> URL: http://svn.freebsd.org/changeset/base/230869 >> >> Log: >> Change the notes about the pidfile to include Doug's preference >> for pre-creating the pidfile with appropriate owner and permissions. >> >> Requested by dougb > > Pre-creating pidfiles? That sounds weird. The common practise is to turn > eg. /var/run/.pid into /var/run//pid where directory > has appropriate permissions. Pre-creating pidfiles is simply wrong, > because applications create pidfile on start and unlink it on exit. > If application has no permission to remove files from /var/run/ it will > leave pidfile with stale PID in it, which is bad. Changing application > to truncate pidfile on exit instead of unlinking it also is a bad idea > especially because there is working solution - pid directory. > Hi, There's even worse problem - kernel closes pidfile in execvp() because of FD_CLOEXEC flag is set and daemon doesn't hold lock on pidfile. I reported about that earlier, but was ignored. -- Andrey Zonov