From owner-freebsd-questions@FreeBSD.ORG Mon Jan 26 02:06:17 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5BCCB106566C for ; Mon, 26 Jan 2009 02:06:17 +0000 (UTC) (envelope-from fbsd.questions@rachie.is-a-geek.net) Received: from mail.rachie.is-a-geek.net (rachie.is-a-geek.net [66.230.99.27]) by mx1.freebsd.org (Postfix) with ESMTP id 23ACF8FC0A for ; Mon, 26 Jan 2009 02:06:16 +0000 (UTC) (envelope-from fbsd.questions@rachie.is-a-geek.net) Received: from localhost (mail.rachie.is-a-geek.net [192.168.2.101]) by mail.rachie.is-a-geek.net (Postfix) with ESMTP id F1464AFC206; Sun, 25 Jan 2009 17:06:15 -0900 (AKST) From: Mel To: freebsd-questions@freebsd.org Date: Sun, 25 Jan 2009 17:06:15 -0900 User-Agent: KMail/1.9.10 References: <20090125113516.GB33731@screwed.box> In-Reply-To: <20090125113516.GB33731@screwed.box> MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200901251706.15683.fbsd.questions@rachie.is-a-geek.net> Cc: Peter Vereshagin Subject: Re: jail init, but another question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jan 2009 02:06:17 -0000 On Sunday 25 January 2009 02:35:16 Peter Vereshagin wrote: > Hello, > > I always try to set up the devfs ruleset in rc.conf. So my question is > about this in /etc/defaults/rc.conf: === > #jail_example_devfs_ruleset="ruleset_name" # devfs ruleset to apply to > jail === > > It appears not to work in /etc/rc.conf without this rc.subr patch: > === > $ diff -u /etc/rc.subr /usr/src/etc/rc.subr > --- /etc/rc.subr 2008-07-20 19:26:20.000000000 +0500 > +++ /usr/src/etc/rc.subr 2008-05-12 12:29:03.000000000 +0500 > @@ -1242,7 +1242,7 @@ > devfs_set_ruleset() > { > local devdir rs _me > - [ -n "$1" ] && eval rs=\$1 || rs= > + [ -n "$1" ] && eval rs=\$$1 || rs= > [ -n "$2" ] && devdir="-m "$2"" || devdir= > _me="devfs_set_ruleset" > === > > And, by far the "ruleset_name" does not work in favour of ruleset number. your patch broke it. eval rs=\$1 means rs will be set to the literal $1, while it should expand to the ruleset number, using the ruleset name, because devfs_rulesets_from_file sets: eval $rulename=\$rulenum Something else is wrong. Set rc_debug="YES" in /etc/rc.conf then /etc/rc.d/jail start example to trace how the rulesets are evaluated. -- Mel Problem with today's modular software: they start with the modules and never get to the software part.