Re: jail init, but another question

2009-01-26 Thread Peter Vereshagin
You'll never silence the voice of the voiceless, Mel!

Yes.
Ruleset name did not resolve into the number. So rc.subr asked for a digit and 
I provided a number that way.
It was too obvious for me to specify the 'devfsrules_' prefix for the case it 
cannot be anything other than devfs rules.
And so it did not resolve by provided meaningful part ( e. g., 'example' ) of 
ruleset name only. Thanks!

2009/01/25 17:06:15 -0900 Mel  => To 
freebsd-questions@freebsd.org :
M> Something else is wrong. Set rc_debug="YES" in /etc/rc.conf then
M> /etc/rc.d/jail start example
M> to trace how the rulesets are evaluated.

73! Peter
-- 
http://vereshagin.org
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: jail init, but another question

2009-01-25 Thread Mel
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.subr2008-07-20 19:26:20.0 +0500
> +++ /usr/src/etc/rc.subr2008-05-12 12:29:03.0 +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.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"