From owner-svn-src-head@FreeBSD.ORG Mon Feb 13 06:20:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A2D71065672; Mon, 13 Feb 2012 06:20:50 +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 B07768FC12; Mon, 13 Feb 2012 06:20:48 +0000 (UTC) Received: by bkcjg1 with SMTP id jg1so4087454bkc.13 for ; Sun, 12 Feb 2012 22:20:47 -0800 (PST) Received: by 10.204.152.25 with SMTP id e25mr5428036bkw.49.1329114047667; Sun, 12 Feb 2012 22:20:47 -0800 (PST) Received: from [10.254.254.77] (ppp95-165-146-120.pppoe.spdop.ru. [95.165.146.120]) by mx.google.com with ESMTPS id cz3sm42974110bkb.3.2012.02.12.22.20.46 (version=SSLv3 cipher=OTHER); Sun, 12 Feb 2012 22:20:47 -0800 (PST) Message-ID: <4F38ABBD.7080502@zonov.org> Date: Mon, 13 Feb 2012 10:20:45 +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: Dmitry Morozovsky References: <20120205214647.GI30033@garage.freebsd.pl> <86sjiov29o.fsf@in138.ua3> <20120206082706.GA1324@garage.freebsd.pl> <86wr7zmy8f.fsf@kopusha.home.net> <20120206221742.GA1336@garage.freebsd.pl> <86liodu3me.fsf@in138.ua3> <20120208090600.GA1308@garage.freebsd.pl> <86sjihsln4.fsf@kopusha.home.net> <4F365C10.5050607@zonov.org> <861upz6fcg.fsf@kopusha.home.net> <20120212200253.GC1355@garage.freebsd.pl> <4F38240B.5040507@zonov.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQkfxKeoDkIm4+Cksj/K8jl8n5S3ilQlthjX0oe84R1y7L9zaPxsCmiR+vrKdAeHKI8q6L8i Cc: src-committers@freebsd.org, Pawel Jakub Dawidek , Guy Helmer , svn-src-all@freebsd.org, Mikolaj Golub , svn-src-head@freebsd.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2012 06:20:50 -0000 On 13.02.2012 0:56, Dmitry Morozovsky wrote: > On Mon, 13 Feb 2012, Andrey Zonov wrote: > > [snip] > >>> Please don't. Even if you can't write the pidfile, you should run the >>> service. The same as for pidfile_open() failure as documented in >>> example. Feel free to warn about problem with writing to pidfile, but >>> don't treat it as critial error. >> >> The problem is the following you cannot stop such a service with standard rc.d >> script and empty pidfile. > > As for me, unstoppable (via standard way) service is at least slightly better > than unstartable. > OK, another solution for this problem is do not automatically remove pidfile when pidfile_write() fails. I can explain this. Sometimes daemons crash and I want to restart them. I use cron for this purpose like this: */5 * * * * root /usr/local/etc/rc.d/mydaemon status > /dev/null || /usr/local/etc/rc.d/mydaemon start and if mydaemon doesn't listen any socket or pidfile_write() fails and remove pidfile (it doesn't hold lock on it, in fact) mydaemon will start. If you have other solution -- welcome. -- Andrey Zonov