From owner-freebsd-arch@FreeBSD.ORG Wed Sep 28 16:48:06 2005 Return-Path: X-Original-To: arch@freebsd.org Delivered-To: freebsd-arch@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DA0F616A41F for ; Wed, 28 Sep 2005 16:48:06 +0000 (GMT) (envelope-from yar@comp.chem.msu.su) Received: from comp.chem.msu.su (comp.chem.msu.su [158.250.32.97]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1578E43D48 for ; Wed, 28 Sep 2005 16:48:05 +0000 (GMT) (envelope-from yar@comp.chem.msu.su) Received: from comp.chem.msu.su (localhost [127.0.0.1]) by comp.chem.msu.su (8.13.3/8.13.3) with ESMTP id j8SGm47L013702 for ; Wed, 28 Sep 2005 20:48:04 +0400 (MSD) (envelope-from yar@comp.chem.msu.su) Received: (from yar@localhost) by comp.chem.msu.su (8.13.3/8.13.3/Submit) id j8SGm3SD013701 for arch@freebsd.org; Wed, 28 Sep 2005 20:48:03 +0400 (MSD) (envelope-from yar) Date: Wed, 28 Sep 2005 20:48:03 +0400 From: Yar Tikhiy To: arch@freebsd.org Message-ID: <20050928164803.GA11556@comp.chem.msu.su> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.9i Cc: Subject: Minor issues in our rcNG X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2005 16:48:07 -0000 Hi there, The larger issue I'd like to discuss is as follows. Presently, ${_program} variables are special in that they always override ${command}. Some rc.d scripts (ab)use this to skip setting ${command}, e.g., sshd. Some other scripts (ab)use ${_program} despite they are not just starting ${command} once, e.g., pf, and so make rc.subr think they have functionality that isn't realy there, such as poll. Perhaps it's time to separate these two cases in a way? I can see two possible approaches. One is to require scripts just starting a daemon always set ${command}, and to apply the attached patch to rc.subr. With the patch, ${command} is overridden only if it was set in the first place. The other approach is to prevent non-daemon scripts from abusing ${_program}. However, in the latter case defining ${_program}, e.g., by mistake, still can affect the script while it should not. The second issue is rather small. The rc command "reload" is supported by code in /etc/rc.subr, but it doesn't appear on the default list of commands unlike "status" or "poll" when there is ${pidfile} or ${command} set, and so it is unusable by default. Scripts have to use ``extra_commands=reload''. In addition, all this is undocumented. Should "reload" be added to the list of available commands along with "status" and "poll"? Finally, we have a script named rcconf.sh which doesn't seem to do anything useful now since all the other scripts invoke load_rc_config by their own. Can we drop it then? -- Yar --- rc.subr~ 2005/08/24 16:37:28 +++ rc.subr 2005/09/20 00:03:41 @@ -493,9 +493,7 @@ esac eval _overide_command=\$${name}_program - if [ -n "$_overide_command" ]; then - command=$_overide_command - fi + command=${command:+${_overide_command:-$command}} _keywords="start stop restart rcvar $extra_commands" rc_pid=