From owner-freebsd-current@FreeBSD.ORG Sat Jan 28 22:47:57 2012 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DE8C106564A for ; Sat, 28 Jan 2012 22:47:57 +0000 (UTC) (envelope-from danielsh@apache.org) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1.freebsd.org (Postfix) with SMTP id 686238FC19 for ; Sat, 28 Jan 2012 22:47:57 +0000 (UTC) Received: (qmail 70019 invoked by uid 99); 28 Jan 2012 22:47:56 -0000 Received: from minotaur.apache.org (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 28 Jan 2012 22:47:56 +0000 Received: from localhost (HELO daniel3.local) (127.0.0.1) (smtp-auth username danielsh, mechanism plain) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Sat, 28 Jan 2012 22:47:56 +0000 Date: Sun, 29 Jan 2012 00:47:40 +0200 From: Daniel Shahaf To: "Bjoern A. Zeeb" Message-ID: <20120128224740.GA1729@daniel3.local> References: <4F22D9FD.10502@p6m7g8.com> <20120128081919.GA6699@lp-shahaf.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-Mailman-Approved-At: Sun, 29 Jan 2012 00:13:39 +0000 Cc: Scott Sanders , Matt Mullins , "Philip M. Gollucci" , current@freebsd.org Subject: Re: jid and jname are numberic by default why? Can we change it ? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 22:47:57 -0000 Bjoern A. Zeeb wrote on Sat, Jan 28, 2012 at 21:06:59 +0000: > > On 28. Jan 2012, at 08:19 , Daniel Shafaf wrote: > > > Matt Mullins wrote on Fri, Jan 27, 2012 at 12:06:48 -0800: > >> On Fri, Jan 27, 2012 at 9:08 AM, Philip M. Gollucci wrote: > >>> All, > >>> > >>> $ jls -nq | tail -1 | xargs -n1 | egrep '^(name|jid)='| xargs > >>> jid=17 name=17 > >>> > >>> # jubilee/chef > >>> jail_jubilee_hostname="jubilee.dca1.rws" > >>> jail_jubilee_ip="192.168.2.41" > >>> jail_jubilee_ip_multi0="192.168.2.42" > >>> jail_jubilee_interface="bge1" > >>> jail_jubilee_rootdir="/jubilee" > >>> jail_jubilee_devfs_enable="YES" > >> > >> The default flags that /etc/rc.d/jail passes to jail(8) are "-l -U > >> root". Failing to give jail(8) a name results in name==jid, as you > >> found above. > >> > >> You can make the rc script name the jail by setting: > >> jail_jubilee_flags="-n jubilee -l -U root" > >> > > > > Good point. Would it make sense to have rc.d/jail behave this way by > > default? > > > > % diff -u /etc/rc.d/jail jail > > --- /etc/rc.d/jail 2012-01-21 18:22:26.000000000 +0200 > > +++ jail 2012-01-28 10:13:03.000000000 +0200 > > @@ -112,7 +112,7 @@ > > eval _fstab=\"\${jail_${_j}_fstab:-${jail_fstab}}\" > > [ -z "${_fstab}" ] && _fstab="/etc/fstab.${_j}" > > eval _flags=\"\${jail_${_j}_flags:-${jail_flags}}\" > > - [ -z "${_flags}" ] && _flags="-l -U root" > > + [ -z "${_flags}" ] && _flags="-n ${_j} -l -U root" > > eval _consolelog=\"\${jail_${_j}_consolelog:-${jail_consolelog}}\" > > [ -z "${_consolelog}" ] && _consolelog="/var/log/jail_${_j}_console.log" > > eval _fib=\"\${jail_${_j}_fib:-${jail_fib}}\" > > > > No. rc.d/jail shall not be extended anymore; please see the framework Jamie posted > on freebsd-jail last year and test/review/report back there. > > See http://lists.freebsd.org/pipermail/freebsd-jail/2011-July/thread.html#1568 > It appears that the problem is already solved in that framework: a jail.conf(5) block defining a jail is required to be preceded by a jailname{}, which is documented to set the jail(8)'s name. In other words, it won't be possible to define in jail.conf(5) a jail that will end up nameless (and thus implicitly named as its jid). Thanks for the pointer, Daniel [1] http://svn.freebsd.org/base/projects/jailconf/usr.sbin/jail/jail.conf.5 P.S. As an aside, the provision in projects/jailconf/'s jail(8) that it's not possible for 'jail -r' to remove all jails _unless_ the '*' syntax is used seems unusual to me: I expect 'jail -r foo bar' to remove those two jails regardless of whether any other jails exist. (Sorry if this has been discussed already -- it's just an issue I ran across while examining the jail(8) man page in Jamie's framework.) > You get a config file etc and get rid of all the shell "magic" and "nightmare". > > /bz > > > >> Notice the rc script uses the second form of syntax listed in jail(8), > >> at least on 9.0-RELEASE. > > _______________________________________________ > > freebsd-current@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-current > > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" > > -- > Bjoern A. Zeeb You have to have visions! > It does not matter how good you are. It matters what good you do! >