Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Mar 2013 23:43:09 -0600
From:      Jamie Gritton <jamie@FreeBSD.org>
To:        freebsd-jail@FreeBSD.org
Subject:   Re: numeric jail name in jail.conf
Message-ID:  <514D40ED.6060809@FreeBSD.org>
In-Reply-To: <514C3FB8.1090906@inbox.im>
References:  <514C3FB8.1090906@inbox.im>

next in thread | previous in thread | raw e-mail | index | archive | help
On 03/22/13 05:25, Nicolas de Bari Embriz Garcia Rojas wrote:
> Hi, when using a numeric names for a jails something like:
>
> 10 {
>      exec.start = "/bin/sh /etc/rc";
>      exec.stop = "/bin/sh /etc/rc.shutdown";
>      ....
> }
>
> 20 {
>      exec.start = "/bin/sh /etc/rc";
>      exec.stop = "/bin/sh /etc/rc.shutdown";
>      ....
> }
>
> the name (numeric) becomes the jail ID when, therefore when I type a jls
> command i see the  10,and 20 as the jails ID's,
>
> My question is, is this the proper way to explicitly set the id when
> using jail.conf ?
>
> For me, this as been working fine and I can match the jail ids to use
> rctl on every reboot, but just want to be sure if this is the correct
> way of doing it.
>
> thanks in advance.

That's a fine and proper way to do it. You can also set it in the body
of the jail definition with e.g. "jid = 10". For that matter, these two
definitions are nearly equivalent:

10 {
     name = "foo";
     ...
}

foo {
     jid = 10;
     ...
}

I say "nearly" because while they'll create the same jail, you would use
10 or foo respectively on the command line if you were operating on one
of them. For example, if you wanted to start only one jail in a conf
file, "jail -c foo" would work only for the second definition.

- Jamie



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?514D40ED.6060809>