From owner-freebsd-rc@FreeBSD.ORG Sun Jun 10 05:11:37 2012 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CAD8106566B; Sun, 10 Jun 2012 05:11:37 +0000 (UTC) (envelope-from sahil@tandon.net) Received: from cricket.hamla.org (cricket.hamla.org [206.251.255.31]) by mx1.freebsd.org (Postfix) with ESMTP id 022328FC0A; Sun, 10 Jun 2012 05:11:37 +0000 (UTC) Received: from magic.hamla.org (cpe-68-174-134-215.nyc.res.rr.com [68.174.134.215]) by cricket.hamla.org (Postfix) with ESMTPSA id 2ACDA8A06A; Sun, 10 Jun 2012 01:11:36 -0400 (EDT) Date: Sun, 10 Jun 2012 01:11:33 -0400 From: Sahil Tandon To: Doug Barton Message-ID: <20120610051133.GA1497@magic.hamla.org> References: <20120609010405.GA295@magic.hamla.org> <4FD38ED0.7070803@FreeBSD.org> <20120610040657.GA1415@magic.hamla.org> <4FD42381.5080504@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4FD42381.5080504@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Scanned: clamav-milter 0.97.3 at cricket.hamla.org X-Virus-Status: Clean Cc: freebsd-rc@freebsd.org Subject: Re: RESEND: [sahil@tandon.net: Request for review: mail/postfix-postfwd rc script] X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Sahil Tandon List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jun 2012 05:11:37 -0000 On Sat, 2012-06-09 at 21:33:05 -0700, Doug Barton wrote: > ... > > One thing I retained is start_precmd, which is needed because of an > > upstream bug (I've reported it) which causes the program to silently > > terminate if 'start' is issued when postfwd is already running! Let me > > know if there is a more suitable way to handle this until it is fixed > > upstream. > > That actually shouldn't happen ... > > service named start > named already running? (pid=843). That works with the port in your example as well as most others, but not postfwd. > If you have pidfile defined properly the check you're using should be > handled by rc.subr already. Unless I'm mistaken, we're back to the same core issue that foils the magic of setting pidfile. From /etc/rc.subr: | start) | if [ -z "$rc_fast" -a -n "$rc_pid" ]; then | echo 1>&2 "${name} already running (pid=$rc_pid)." | return 1 | fi And because /etc/rc.subr assumes: rc_pid=$(check_pidfile $pidfile $command) or rc_pid=$(check_process $command) ... rc_pid is unset (because both check_pidfile and check_process are confused due to the aforementioned issues with ps output); thus, the start method is unaware that the program is running. -- Sahil Tandon