From owner-freebsd-stable@FreeBSD.ORG Sun Oct 24 09:04:04 2010 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5862E1065675 for ; Sun, 24 Oct 2010 09:04:04 +0000 (UTC) (envelope-from spil.oss@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id D75A18FC13 for ; Sun, 24 Oct 2010 09:04:03 +0000 (UTC) Received: by fxm17 with SMTP id 17so1965649fxm.13 for ; Sun, 24 Oct 2010 02:04:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:reply-to :in-reply-to:references:date:message-id:subject:from:to:content-type; bh=EMWYFtJwHiqesW3NUmKtYjhMDtgYqVlE9pVcFj3onMY=; b=NicfWQ0anRIe2xBCPX0W+sHwRpk83Rb3v5/+m6QhEnKgEc5wd6ej1EM9YgyeBK1ep9 u3cbrdrASCP4CcUEWyB/iVwST5DE5PO9xqZaO4NehHBn5Yt0xaOByiSXdPPu8NlLcLo2 JodRUxoiuPpdJLTw6+zoE3XYGScV5vaC4QlG0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type; b=h3nwzU671G/pOxxJGOcN9RIEOIVykF4HoqzgNl2pvnyQsJy/G9Kc3NPgepDKsOArLN 4++Rx6Y28NSKcMzjJxYc23OPzI8KZOvBZepm6R0Mk6vBe40HSJNypBb7T2C2qZDHOoVV ddTBllUdIgheVQ6wA19Z330pMAwgYNX33Sm2I= MIME-Version: 1.0 Received: by 10.103.175.13 with SMTP id c13mr6391773mup.30.1287911042658; Sun, 24 Oct 2010 02:04:02 -0700 (PDT) Received: by 10.223.111.140 with HTTP; Sun, 24 Oct 2010 02:04:02 -0700 (PDT) In-Reply-To: References: Date: Sun, 24 Oct 2010 11:04:02 +0200 Message-ID: From: Spil Oss To: freebsd-stable@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: Name and JID support in /etc/rc.d/jail and jail(8) documentation X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: spil.oss@gmail.com List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Oct 2010 09:04:04 -0000 Hi All, Created a small patch for 8.1 to add name support to /etc/rc.d/jail. This doesn't upgrade /etc/rc.d/jail to the overhauled invocation of 8.0 but merely adds the ability to set a jail's name on start which was added in FreeBSD 7.2 (May 2009). Could this patch be considered to be applied to stable? # diff -ruN /etc/rc.d/jail-8.1 /etc/rc.d/jail --- /etc/rc.d/jail-8.1 2010-07-21 07:19:46.000000000 +0200 +++ /etc/rc.d/jail 2010-10-24 10:55:14.000000000 +0200 @@ -38,6 +38,7 @@ _fdescdir="${_devdir}/fd" _procdir="${_rootdir}/proc" eval _hostname=\"\$jail_${_j}_hostname\" + eval _name=\"\$jail_${_j}_name\" eval _ip=\"\$jail_${_j}_ip\" eval _interface=\"\${jail_${_j}_interface:-${jail_interface}}\" eval _exec=\"\$jail_${_j}_exec\" @@ -122,6 +123,7 @@ debug "$_j procfs enable: $_procfs" debug "$_j mount enable: $_mount" debug "$_j hostname: $_hostname" + debug "$_j name: $_name" debug "$_j ip: $_ip" jail_show_addresses ${_j} debug "$_j interface: $_interface" @@ -635,6 +637,10 @@ i=$((i + 1)) done + if [ -n "${_name}" ] ; then + _flags="${_flags} -n ${_name}" + fi + eval ${_setfib} jail ${_flags} -i ${_rootdir} ${_hostname} \ \"${_addrl}\" ${_exec_start} > ${_tmp_jail} 2>&1 Kind regards, Spil. On Sun, Oct 24, 2010 at 10:52 AM, Spil Oss wrote: > Hi All, > > When starting a jail you can, as of 8.0 if I'm not mistaken, set the > JID and name for a jail. This change doesn't seem to have been > incorporated into the /etc/rc.d/jail script? Looking at > http://wiki.polymorf.fr/index.php/Howto:FreeBSD_jail_vnet it wouldn't > be a huge change to add name support. The other additions in that > script look a lot more intrusive. Are there any plans to merge this > patch into the jail rc-script or is this "v2" style of jail invocation > still considered to be experimental? As of 8.1 is seems to no longer > be considered experimental looking at the release notes. > > The jail(8) documentation (mine lists FreeBSD 8.1 January 17, 2010) > seems to be missing documentation on the vnet command (due to the > experimental status)? > > Kind regards, > > Spil. >