From owner-freebsd-rc@freebsd.org Mon Nov 2 16:26:10 2015 Return-Path: Delivered-To: freebsd-rc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79440A24153 for ; Mon, 2 Nov 2015 16:26:10 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5DACD19B2 for ; Mon, 2 Nov 2015 16:26:10 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id tA2GQAa2013971 for ; Mon, 2 Nov 2015 16:26:10 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-rc@FreeBSD.org Subject: [Bug 204215] [patch] [feature-request] make rc.initdiskless more embedded-friendly and support auxiliary NVRAM Date: Mon, 02 Nov 2015 16:26:10 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: conf X-Bugzilla-Version: 11.0-CURRENT X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: linimon@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-rc@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: assigned_to Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list 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: Mon, 02 Nov 2015 16:26:10 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204215 Mark Linimon changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|freebsd-bugs@FreeBSD.org |freebsd-rc@FreeBSD.org -- You are receiving this mail because: You are the assignee for the bug. From owner-freebsd-rc@freebsd.org Tue Nov 3 22:22:49 2015 Return-Path: Delivered-To: freebsd-rc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A8CBA24FD2 for ; Tue, 3 Nov 2015 22:22:49 +0000 (UTC) (envelope-from erdgeist@erdgeist.org) Received: from elektropost.org (elektropost.org [217.115.13.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92D5E1CA2 for ; Tue, 3 Nov 2015 22:22:44 +0000 (UTC) (envelope-from erdgeist@erdgeist.org) Received: (qmail 60939 invoked from network); 3 Nov 2015 22:22:36 -0000 Received: from elektropost.org (HELO elektropost.org) (erdgeist@erdgeist.org) by elektropost.org with ESMTPS (DHE-RSA-AES128-SHA encrypted); 3 Nov 2015 22:22:36 -0000 To: freebsd-rc@FreeBSD.org From: Dirk Engling X-Enigmail-Draft-Status: N1110 Subject: etc/rc.subr rc_pid for start_cmd Message-ID: <563933AB.5090407@erdgeist.org> Date: Tue, 3 Nov 2015 23:22:35 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list 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: Tue, 03 Nov 2015 22:22:49 -0000 Dear rc hackers, while fixing startup scripts for qmail I fell for the trap to assume rc.subr to do the "${name} already running? " check for me. When I then compared my rc script to several others from various ports/*/*/files/ directories I could not spot any difference until I noticed they were also doing it wrong, and would happily spawn more daemons when their custom start_cmd was invoked. I then went over a list returned from "grep -ri start_cmd /usr/ports/" and found that around a third of tools (that install their rc scripts from the /files/ directory, i.e. they were written by FreeBSD port maintainers, not some unwashed Linux hippies, who do not know better) do not really do the check either. While the other 2/3 hilariously re-implemented the rc.subr check in the most creative ways. Has there been any historic reason this check was not done somewhere around /etc/rc.subr:2088 like if [ $rc_arg = "start" -a -z "$rc_fast" -a -n "$rc_pid" ]; then if [ -z "$rc_quiet" ]; then echo 1>&2 "${name} already running? " \ "(pid=$rc_pid)." fi return 1 fi maybe with a knob to turn that off for daemons that really know what they're doing? If not I propose to move the check before custom ${XXX_cmd} evaluation and will be glad to provide a diff. erdgeist From owner-freebsd-rc@freebsd.org Tue Nov 3 23:13:15 2015 Return-Path: Delivered-To: freebsd-rc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53A8DA25B03 for ; Tue, 3 Nov 2015 23:13:15 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A9DD14DD for ; Tue, 3 Nov 2015 23:13:15 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 0F2F2B8071; Wed, 4 Nov 2015 00:13:11 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id EB88F28494; Wed, 4 Nov 2015 00:13:10 +0100 (CET) Date: Wed, 4 Nov 2015 00:13:10 +0100 From: Jilles Tjoelker To: Dirk Engling Cc: freebsd-rc@FreeBSD.org Subject: Re: etc/rc.subr rc_pid for start_cmd Message-ID: <20151103231310.GA70094@stack.nl> References: <563933AB.5090407@erdgeist.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <563933AB.5090407@erdgeist.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list 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: Tue, 03 Nov 2015 23:13:15 -0000 On Tue, Nov 03, 2015 at 11:22:35PM +0100, Dirk Engling wrote: > while fixing startup scripts for qmail I fell for the trap to assume > rc.subr to do the "${name} already running? " check for me. When I then > compared my rc script to several others from various ports/*/*/files/ > directories I could not spot any difference until I noticed they were > also doing it wrong, and would happily spawn more daemons when their > custom start_cmd was invoked. > I then went over a list returned from "grep -ri start_cmd /usr/ports/" > and found that around a third of tools (that install their rc scripts > from the /files/ directory, i.e. they were written by FreeBSD port > maintainers, not some unwashed Linux hippies, who do not know better) do > not really do the check either. While the other 2/3 hilariously > re-implemented the rc.subr check in the most creative ways. > Has there been any historic reason this check was not done somewhere > around /etc/rc.subr:2088 like > if [ $rc_arg = "start" -a -z "$rc_fast" -a -n "$rc_pid" ]; then > if [ -z "$rc_quiet" ]; then > echo 1>&2 "${name} already running? " \ > "(pid=$rc_pid)." > fi > return 1 > fi > maybe with a knob to turn that off for daemons that really know what > they're doing? If not I propose to move the check before custom > ${XXX_cmd} evaluation and will be glad to provide a diff. The original idea was to skip the "already running" checks while booting the system since they are quite slow, and to perform them when a manual service FOO start is done. -- Jilles Tjoelker From owner-freebsd-rc@freebsd.org Tue Nov 3 23:35:20 2015 Return-Path: Delivered-To: freebsd-rc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A30F9A25E9B for ; Tue, 3 Nov 2015 23:35:20 +0000 (UTC) (envelope-from erdgeist@erdgeist.org) Received: from elektropost.org (elektropost.org [217.115.13.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E76E61DDF for ; Tue, 3 Nov 2015 23:35:18 +0000 (UTC) (envelope-from erdgeist@erdgeist.org) Received: (qmail 81100 invoked from network); 3 Nov 2015 23:35:15 -0000 Received: from elektropost.org (HELO elektropost.org) (erdgeist@erdgeist.org) by elektropost.org with ESMTPS (DHE-RSA-AES128-SHA encrypted); 3 Nov 2015 23:35:15 -0000 Subject: Re: etc/rc.subr rc_pid for start_cmd To: Jilles Tjoelker References: <563933AB.5090407@erdgeist.org> <20151103231310.GA70094@stack.nl> Cc: freebsd-rc@FreeBSD.org From: Dirk Engling Message-ID: <563944B3.5030604@erdgeist.org> Date: Wed, 4 Nov 2015 00:35:15 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151103231310.GA70094@stack.nl> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list 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: Tue, 03 Nov 2015 23:35:20 -0000 > The original idea was to skip the "already running" checks while booting > the system since they are quite slow, and to perform them when a manual > service FOO start is done. Isn't this what the -z "$rc_fast" is for? >> if [ $rc_arg = "start" -a -z "$rc_fast" -a -n "$rc_pid" ]; then >> if [ -z "$rc_quiet" ]; then erdgeist