From owner-freebsd-rc@FreeBSD.ORG Mon Jul 24 11:03:33 2006 Return-Path: X-Original-To: freebsd-rc@freebsd.org Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5D5B816A50A for ; Mon, 24 Jul 2006 11:03:33 +0000 (UTC) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1DD2043DBD for ; Mon, 24 Jul 2006 11:03:01 +0000 (GMT) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (peter@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k6OB31BX013757 for ; Mon, 24 Jul 2006 11:03:01 GMT (envelope-from owner-bugmaster@freebsd.org) Received: (from peter@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k6OB2wBF013753 for freebsd-rc@freebsd.org; Mon, 24 Jul 2006 11:02:58 GMT (envelope-from owner-bugmaster@freebsd.org) Date: Mon, 24 Jul 2006 11:02:58 GMT Message-Id: <200607241102.k6OB2wBF013753@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: peter set sender to owner-bugmaster@freebsd.org using -f From: FreeBSD bugmaster To: freebsd-rc@FreeBSD.org Cc: Subject: Current problem reports assigned to you X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 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, 24 Jul 2006 11:03:33 -0000 Current FreeBSD problem reports Critical problems Serious problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2003/03/03] conf/48881 rc [PATCH] The influence of /etc/start_ifnam o [2006/06/09] conf/98734 rc [patch] /etc/rc.subr restart_postcmd is f 2 problems total. Non-critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2002/11/12] conf/45226 rc Fix for rc.network, ppp-user annoyance o [2003/03/03] conf/48870 rc [PATCH] rc.network: allow to cancel inter o [2003/08/24] conf/55916 rc [PATCH] ppp-user options o [2003/11/04] conf/58939 rc [patch] dumb little hack for /etc/rc.fire o [2004/11/08] conf/73677 rc [patch] add support for powernow states t o [2004/12/07] conf/74817 rc [patch] network.subr: fixed automatic con o [2005/02/18] conf/77663 rc Suggestion: add /etc/rc.d/addnetswap afte o [2005/03/16] conf/78906 rc [patch] Allow mixer_enable="NO" in rc.con o [2005/03/24] conf/79196 rc [PATCH] configurable dummynet loading fr o [2005/05/14] kern/81006 rc ipnat not working with tunnel interfaces o [2005/08/27] conf/85363 rc syntax error in /etc/rc.d/devfs o [2005/09/07] conf/85819 rc [patch] script allowing multiuser mode in o [2005/11/13] conf/88913 rc [patch] wrapper support for rc.subr o [2005/11/15] conf/89061 rc [patch] IPv6 6to4 auto-configuration enha o [2005/12/03] conf/89870 rc [patch] feature request to make netif ver o [2006/01/30] conf/92523 rc [patch] allow rc scripts to kill process o [2006/02/25] conf/93815 rc [patch] Adds in the ability to save ipfw o [2006/03/31] conf/95162 rc [patch] Missing feature in rc.subr o [2006/04/26] conf/96343 rc [patch] rc.d order change to start inet6 o [2006/05/04] conf/96766 rc run_rc_command doesn't work for Python sc o [2006/05/15] conf/97311 rc [patch] /etc/rc.d/ipfilter reload can loa o [2006/06/25] conf/99444 rc [patch] Enhancement: rc.subr could easily o [2006/06/28] conf/99595 rc [PATCH] /etc/rc.d/dhclient doesn't intera o [2006/07/02] conf/99721 rc [patch] /etc/rc.initdiskless problem copy o [2006/07/14] bin/100287 rc /etc/rc.subr cannot deal properly with in 25 problems total. From owner-freebsd-rc@FreeBSD.ORG Mon Jul 24 17:13:13 2006 Return-Path: X-Original-To: freebsd-rc@FreeBSD.org Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 10EC916A4DE for ; Mon, 24 Jul 2006 17:13:13 +0000 (UTC) (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 B1BE943D6E for ; Mon, 24 Jul 2006 17:13:07 +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.4/8.13.3) with ESMTP id k6OHD1gx055732 for ; Mon, 24 Jul 2006 21:13:02 +0400 (MSD) (envelope-from yar@comp.chem.msu.su) Received: (from yar@localhost) by comp.chem.msu.su (8.13.4/8.13.3/Submit) id k6OHD12v055731 for freebsd-rc@FreeBSD.org; Mon, 24 Jul 2006 21:13:01 +0400 (MSD) (envelope-from yar) Date: Mon, 24 Jul 2006 21:13:01 +0400 From: Yar Tikhiy To: freebsd-rc@FreeBSD.org Message-ID: <20060724171301.GA52664@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: Order of _nice, _user, and _chdir X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 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, 24 Jul 2006 17:13:13 -0000 Hi all, I saw a complaint in a Russian BSD newsgroup that it was impossible to assign a negative niceness to the $command process via $foo_nice whenever $foo_user was set to a non-root user. So I took a look at the part of rc.subr dealing with the start of $command. As of now, the order of processing foo_chdir, foo_nice, and foo_user is as follows: user ( chdir ; nice ( command ) ) E.g.: su -m $foo_user -c 'sh -c "cd $foo_chdir ; nice -n $foo_nice $command"' Therefore the command's process(es) may not be assigned a negative niceness because nice(1) is run as the unprivileged $foo_user. In addition, a failure to chdir() will be ignored. IMHO a better order would be: nice ( user ( chdir && command ) ) E.g.: nice -n $foo_nice su -m $foo_user -c 'sh -c "cd $foo_chdir && $command"' nice -n $foo_nice sh -c "cd $foo_chdir && $command" # w/o foo_user The respective patch is attached. Any comments? Thanks. -- Yar Index: rc.subr =================================================================== RCS file: /home/ncvs/src/etc/rc.subr,v retrieving revision 1.59 diff -u -p -r1.59 rc.subr --- rc.subr 21 Jun 2006 09:42:55 -0000 1.59 +++ rc.subr 24 Jul 2006 15:30:53 -0000 @@ -666,12 +666,17 @@ chroot ${_user:+-u $_user }${_group:+-g $_chroot $command $rc_flags $command_args" else _doit="\ -${_chdir:+cd $_chdir; }\ -${_nice:+nice -n $_nice }\ +${_chdir:+cd $_chdir && }\ $command $rc_flags $command_args" if [ -n "$_user" ]; then _doit="su -m $_user -c 'sh -c \"$_doit\"'" fi + if [ -n "$_nice" ]; then + if [ -z "$_user" ]; then + _doit="sh -c \"$_doit\"" + fi + _doit="nice -n $_nice $_doit" + fi fi # if the cmd failed and force From owner-freebsd-rc@FreeBSD.ORG Tue Jul 25 09:10:01 2006 Return-Path: X-Original-To: freebsd-rc@hub.freebsd.org Delivered-To: freebsd-rc@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 34D9516A4DA; Tue, 25 Jul 2006 09:10:01 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id E2AAC43D4C; Tue, 25 Jul 2006 09:10:00 +0000 (GMT) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (linimon@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k6P9A0Ml039885; Tue, 25 Jul 2006 09:10:00 GMT (envelope-from linimon@freefall.freebsd.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k6P9A0BO039881; Tue, 25 Jul 2006 09:10:00 GMT (envelope-from linimon) Date: Tue, 25 Jul 2006 09:10:00 GMT From: Mark Linimon Message-Id: <200607250910.k6P9A0BO039881@freefall.freebsd.org> To: linimon@FreeBSD.org, freebsd-bugs@FreeBSD.org, freebsd-rc@FreeBSD.org Cc: Subject: Re: conf/100799: rc.conf scripts don't create vlan interfaces X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 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, 25 Jul 2006 09:10:01 -0000 Synopsis: rc.conf scripts don't create vlan interfaces Responsible-Changed-From-To: freebsd-bugs->freebsd-rc Responsible-Changed-By: linimon Responsible-Changed-When: Tue Jul 25 09:09:47 UTC 2006 Responsible-Changed-Why: Over to maintainer(s). http://www.freebsd.org/cgi/query-pr.cgi?pr=100799 From owner-freebsd-rc@FreeBSD.ORG Tue Jul 25 11:18:06 2006 Return-Path: X-Original-To: freebsd-rc@hub.freebsd.org Delivered-To: freebsd-rc@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3016E16A4DD; Tue, 25 Jul 2006 11:18:06 +0000 (UTC) (envelope-from yar@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id E460F43D5C; Tue, 25 Jul 2006 11:18:05 +0000 (GMT) (envelope-from yar@FreeBSD.org) Received: from freefall.freebsd.org (yar@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k6PBI5h5053505; Tue, 25 Jul 2006 11:18:05 GMT (envelope-from yar@freefall.freebsd.org) Received: (from yar@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k6PBI5Wm053501; Tue, 25 Jul 2006 11:18:05 GMT (envelope-from yar) Date: Tue, 25 Jul 2006 11:18:05 GMT From: Yar Tikhiy Message-Id: <200607251118.k6PBI5Wm053501@freefall.freebsd.org> To: tpoder@cis.vutbr.cz, yar@FreeBSD.org, freebsd-rc@FreeBSD.org Cc: Subject: Re: conf/100799: rc.conf scripts don't create vlan interfaces X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 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, 25 Jul 2006 11:18:06 -0000 Synopsis: rc.conf scripts don't create vlan interfaces State-Changed-From-To: open->feedback State-Changed-By: yar State-Changed-When: Tue Jul 25 11:12:18 UTC 2006 State-Changed-Why: There is an rc.conf variable named "cloned_interfaces" that should list all network interfaces to create. That is, you also need the following line in your rc.conf: cloned_interfaces="vlan0" This approach has proved more reliable than scanning all shell variable names for the ^ifconfig_ pattern. I believe that cloned_interfaces is documented on rc.conf(5). May I close this PR now? http://www.freebsd.org/cgi/query-pr.cgi?pr=100799 From owner-freebsd-rc@FreeBSD.ORG Tue Jul 25 11:18:46 2006 Return-Path: X-Original-To: freebsd-rc@hub.freebsd.org Delivered-To: freebsd-rc@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DDA5B16A4E1; Tue, 25 Jul 2006 11:18:46 +0000 (UTC) (envelope-from yar@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4FE5543D5D; Tue, 25 Jul 2006 11:18:46 +0000 (GMT) (envelope-from yar@FreeBSD.org) Received: from freefall.freebsd.org (yar@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k6PBIkYx053558; Tue, 25 Jul 2006 11:18:46 GMT (envelope-from yar@freefall.freebsd.org) Received: (from yar@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k6PBIkPF053554; Tue, 25 Jul 2006 11:18:46 GMT (envelope-from yar) Date: Tue, 25 Jul 2006 11:18:46 GMT From: Yar Tikhiy Message-Id: <200607251118.k6PBIkPF053554@freefall.freebsd.org> To: yar@FreeBSD.org, freebsd-rc@FreeBSD.org, yar@FreeBSD.org Cc: Subject: Re: conf/100799: rc.conf scripts don't create vlan interfaces X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 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, 25 Jul 2006 11:18:46 -0000 Synopsis: rc.conf scripts don't create vlan interfaces Responsible-Changed-From-To: freebsd-rc->yar Responsible-Changed-By: yar Responsible-Changed-When: Tue Jul 25 11:18:13 UTC 2006 Responsible-Changed-Why: /me handling this PR. http://www.freebsd.org/cgi/query-pr.cgi?pr=100799 From owner-freebsd-rc@FreeBSD.ORG Tue Jul 25 17:39:35 2006 Return-Path: X-Original-To: freebsd-rc@FreeBSD.org Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2460F16A501; Tue, 25 Jul 2006 17:39:35 +0000 (UTC) (envelope-from tpoder@cis.vutbr.cz) Received: from racoon.cis.vutbr.cz (racoon.cis.vutbr.cz [147.229.3.18]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0D93443D76; Tue, 25 Jul 2006 17:39:30 +0000 (GMT) (envelope-from tpoder@cis.vutbr.cz) Received: from flamingo.cis.vutbr.cz (flamingo.cis.vutbr.cz [147.229.3.46]) by racoon.cis.vutbr.cz (8.13.7/8.12.11/VUT Brno) with ESMTP id k6PHdNWD032355 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 25 Jul 2006 19:39:27 +0200 (CEST) (envelope-from tpoder@cis.vutbr.cz) Received: from [192.168.1.101] (r2bd252.chello.upc.cz [62.245.119.252]) (authenticated bits=0) by flamingo.cis.vutbr.cz (8.13.7/8.12.11/VUT v Brne) with ESMTP id k6PHdN6R032727 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 25 Jul 2006 19:39:23 +0200 (CEST) (envelope-from tpoder@cis.vutbr.cz) Message-ID: <44C6574E.9030409@cis.vutbr.cz> Date: Tue, 25 Jul 2006 19:39:26 +0200 From: Tomas Podermanski User-Agent: Thunderbird 1.5 (X11/20060317) MIME-Version: 1.0 To: Yar Tikhiy References: <200607251118.k6PBI5Wm053501@freefall.freebsd.org> In-Reply-To: <200607251118.k6PBI5Wm053501@freefall.freebsd.org> Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -4.901 () BAYES_00 set by racoon.cis.vutbr.cz X-Spam-Skore: , -4.901 set by racoon.cis.vutbr.cz X-Scanned-By: MIMEDefang 2.38 Cc: freebsd-rc@FreeBSD.org Subject: Re: conf/100799: rc.conf scripts don't create vlan interfaces X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 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, 25 Jul 2006 17:39:35 -0000 Dear Yar, I think cloned_interfaces is good solition of this problem. I've ommited this option. Thank for your time. TP Yar Tikhiy wrote: > Synopsis: rc.conf scripts don't create vlan interfaces > > State-Changed-From-To: open->feedback > State-Changed-By: yar > State-Changed-When: Tue Jul 25 11:12:18 UTC 2006 > State-Changed-Why: > There is an rc.conf variable named "cloned_interfaces" that > should list all network interfaces to create. That is, > you also need the following line in your rc.conf: > > cloned_interfaces="vlan0" > > This approach has proved more reliable than scanning all shell > variable names for the ^ifconfig_ pattern. > > I believe that cloned_interfaces is documented on rc.conf(5). > > May I close this PR now? > > http://www.freebsd.org/cgi/query-pr.cgi?pr=100799 > From owner-freebsd-rc@FreeBSD.ORG Tue Jul 25 21:05:36 2006 Return-Path: X-Original-To: freebsd-rc@FreeBSD.org Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 825F916A4DE; Tue, 25 Jul 2006 21:05:36 +0000 (UTC) (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 8F46043D55; Tue, 25 Jul 2006 21:05:35 +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.4/8.13.3) with ESMTP id k6PKe1PS074858; Wed, 26 Jul 2006 00:40:02 +0400 (MSD) (envelope-from yar@comp.chem.msu.su) Received: (from yar@localhost) by comp.chem.msu.su (8.13.4/8.13.3/Submit) id k6PKe1mb074853; Wed, 26 Jul 2006 00:40:01 +0400 (MSD) (envelope-from yar) Date: Wed, 26 Jul 2006 00:40:01 +0400 From: Yar Tikhiy To: Doug Barton Message-ID: <20060725204001.GC73669@comp.chem.msu.su> References: <20060722111449.GE10321@comp.chem.msu.su> <44C2687A.3030102@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <44C2687A.3030102@FreeBSD.org> User-Agent: Mutt/1.5.9i Cc: freebsd-rc@FreeBSD.org Subject: Re: Generalising ${required_*} X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 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, 25 Jul 2006 21:05:36 -0000 On Sat, Jul 22, 2006 at 11:03:38AM -0700, Doug Barton wrote: > Yar Tikhiy wrote: > > Hi all, > > > > As of now, the ${required_*} variables work only in rc.d scripts > > using the default start method. I've found that making ${required_*} > > work in scripts that override the default start method can help us > > to reduce code duplication in /etc/rc.d. In particular, I'd like > > to introduce ${required_modules} because quite a few scripts have > > to have a prestart method just to load a kernel module. > > > > Do you think such change would make sense? Thanks. > > > > Its prototype can be found in my P4 tree: > > //depot/user/yar/hack/etc/... > > (also available via www at http://perforce.freebsd.org) > > For those of us who are p4 impaired, can you give us a URL to view the > changes you're proposing? Thank you for requesting this! It encouraged me to test my changes at last and prepare a good old patch :-) http://people.freebsd.org/~yar/required_modules.patch Its top part converts quite a few rc.d scripts to using $required_modules if possible or load_kld() otherwise in place of raw kldload. The respective changes to rc.subr and rc.subr.8 appear at the bottom of the patch. -- Yar