From owner-freebsd-questions@FreeBSD.ORG Mon Aug 25 07:11:15 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DCE833B0 for ; Mon, 25 Aug 2014 07:11:15 +0000 (UTC) Received: from agora.rdrop.com (agora.rdrop.com [IPv6:2607:f678:1010::34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B88C237C6 for ; Mon, 25 Aug 2014 07:11:15 +0000 (UTC) Received: from agora.rdrop.com (66@localhost [127.0.0.1]) by agora.rdrop.com (8.13.1/8.12.7) with ESMTP id s7P7BB55092222 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 25 Aug 2014 00:11:12 -0700 (PDT) (envelope-from perryh@pluto.rain.com) Received: (from uucp@localhost) by agora.rdrop.com (8.13.1/8.14.2/Submit) with UUCP id s7P7BBKN092221; Mon, 25 Aug 2014 00:11:11 -0700 (PDT) (envelope-from perryh@pluto.rain.com) Received: from fbsd81 by pluto.rain.com (4.1/SMI-4.1-pluto-M2060407) id AA17473; Mon, 25 Aug 14 00:09:36 PDT Date: Mon, 25 Aug 2014 00:09:37 -0700 From: perryh@pluto.rain.com (Perry Hutchison) To: sclists@gmail.com, erichsfreebsdlist@alogt.com Subject: Re: "hosts" file for jails (ezjail) Message-Id: <53fae131.SSzyZWb9H/N2EkA3%perryh@pluto.rain.com> References: <53FA92E1.7000300@gmail.com> <20140825114658.1ebfaa1c@X220.alogt.com> In-Reply-To: <20140825114658.1ebfaa1c@X220.alogt.com> User-Agent: nail 11.25 7/29/05 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Aug 2014 07:11:15 -0000 Erich Dollansky wrote: > On Sun, 24 Aug 2014 21:35:29 -0400 > Stephen Cook wrote: > > Is there a way to get a bunch of jails (I'm using ezjail) to share > > the same hosts file, preferably one stored somewhere on the host OS? > > ... > > I'd like to be able to update the file when I add a new jail, and > > have the others able to connect to it by whatever stupid name I give > > it, without editing all those different hosts files. But I suspect > > the whole point of jails being kept separate from the host filesystem > > might be in my way. > > what you want is against the idea of jails. Indeed. OTOH one of the longstanding strengths of Unix -- and the motivation for "mechanism, not policy" -- is that mechanisms can often be cleverly used in ways that their designers did not anticipate. > What you can do, creates in the root filesystem the hosts file > and write a script which copies it then into the jails. That (and variants, such as using puppet to maintain the jails' configuration files) is likely the most general approach. In the particular case where all of the jails are contained within the same host filesystem, it should also be possible to use hardlinks (so that all the jails share the same inode). Granted this would enable any jail to overwrite what the others see -- which may or may not be acceptable in the OP's situation.