From owner-freebsd-hackers@FreeBSD.ORG Mon Sep 27 13:05:50 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 666C4106566C for ; Mon, 27 Sep 2010 13:05:50 +0000 (UTC) (envelope-from fb-hackers@psconsult.nl) Received: from mx1.psconsult.nl (unknown [IPv6:2001:7b8:30f:e0::5059:ee8a]) by mx1.freebsd.org (Postfix) with ESMTP id 1ECD98FC15 for ; Mon, 27 Sep 2010 13:05:49 +0000 (UTC) Received: from mx1.psconsult.nl (psc11.adsl.iaf.nl [80.89.238.138]) by mx1.psconsult.nl (8.14.4/8.14.4) with ESMTP id o8RD5hUE038887 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 27 Sep 2010 15:05:48 +0200 (CEST) (envelope-from fb-hackers@psconsult.nl) Received: (from paul@localhost) by mx1.psconsult.nl (8.14.4/8.14.4/Submit) id o8RD5hQW038886 for freebsd-hackers@freebsd.org; Mon, 27 Sep 2010 15:05:43 +0200 (CEST) (envelope-from fb-hackers@psconsult.nl) X-Authentication-Warning: mx1.psconsult.nl: paul set sender to fb-hackers@psconsult.nl using -f Date: Mon, 27 Sep 2010 15:05:43 +0200 From: Paul Schenkeveld To: freebsd-hackers@freebsd.org Message-ID: <20100927130542.GA38728@psconsult.nl> References: <20100927150421.260874f0@amnesiac.pht> <20100927120129.GF95673@e.0x20.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100927120129.GF95673@e.0x20.net> User-Agent: Mutt/1.5.19 (2009-01-05) Subject: Re: little mistake in rc.subr? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Sep 2010 13:05:50 -0000 On Mon, Sep 27, 2010 at 02:01:29PM +0200, Lars Engels wrote: > On Mon, Sep 27, 2010 at 03:04:21PM +0400, Dmitry Banshchikov wrote: > > Hello, > > > > In /etc/rc.subr, at line 231, there is: > > > > if [ ! -f $_pidfile ]; then > > debug "pid file ($_pidfile): not readable." > > return > > fi > > > > Is check "[ ! -r $_pidfile ]" more correct? > > There's pratically no difference. rc stuff is run as root, so if there's > a file, it's readable, if there's no file, then the debug message is > printed. And -f also checks that it is a regular file (or symlink to a regular file).