From owner-freebsd-bugs@FreeBSD.ORG Fri Jul 12 19:20:02 2013 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 665874B4 for ; Fri, 12 Jul 2013 19:20:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 481BF1A99 for ; Fri, 12 Jul 2013 19:20:02 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CJK2YP078545 for ; Fri, 12 Jul 2013 19:20:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r6CJK2md078544; Fri, 12 Jul 2013 19:20:02 GMT (envelope-from gnats) Resent-Date: Fri, 12 Jul 2013 19:20:02 GMT Resent-Message-Id: <201307121920.r6CJK2md078544@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Frank Leonhardt Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 51CA329F for ; Fri, 12 Jul 2013 19:14:38 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121]) by mx1.freebsd.org (Postfix) with ESMTP id 4458D1A00 for ; Fri, 12 Jul 2013 19:14:38 +0000 (UTC) Received: from oldred.freebsd.org ([127.0.1.6]) by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r6CJEbva093732 for ; Fri, 12 Jul 2013 19:14:37 GMT (envelope-from nobody@oldred.freebsd.org) Received: (from nobody@localhost) by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r6CJEbj5093731; Fri, 12 Jul 2013 19:14:37 GMT (envelope-from nobody) Message-Id: <201307121914.r6CJEbj5093731@oldred.freebsd.org> Date: Fri, 12 Jul 2013 19:14:37 GMT From: Frank Leonhardt To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: misc/180521: Configuring jail in rc.conf fails to set the jail name correctly X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jul 2013 19:20:02 -0000 >Number: 180521 >Category: misc >Synopsis: Configuring jail in rc.conf fails to set the jail name correctly >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Jul 12 19:20:01 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Frank Leonhardt >Release: 9.0 (and others) >Organization: >Environment: n/a >Description: When you configure a jail in rc.conf you give the jail a name and refer to this when using the "service" command to turn it on and off subsequently. However, the jail name is not set as far as the jail system is concerned - if you use jls -v, for example, it will be seen that the name is the same as the jail-ID. This is the default for the "jail" command when no name is specified, but it's not helpful when you've named a jail and might reasonably want to go on referring to it by that name. >How-To-Repeat: Create a jailed environments in /usr/jail1, jail2, jail3 &c Add the following to rc.conf: jail_enable="YES" jail_list="jail1 jail2 jail3" jail_jail1_rootdir="/usr/jail1" jail_jail1_hostname="jail1.yourdomain" jail_jail1_ip="192.168.1.211" And so on... Boot the machine or start a jail with: service jail start jail1 or /etc/rc.d/jail start jail1 Check to see if it's actually called jail1: jls -v Output will be: bsd9-1# jls -v JID Hostname Path Name State CPUSetID IP Address(es) 5 jail1.yourdomain /usr/jail1 4 ACTIVE 5 192.168.1.215 It should say "jail1" in the position where it says "4" This fails every time! >Fix: Easy... On line 647 of /etc/rc.d/jail add the -n option. Current: eval ${_setfib} jail ${_flags} -i ${_rootdir} ${_hostname} \ \"${_addrl}\" ${_exec_start} > ${_tmp_jail} 2>&1 \ ${_tmp_jail} 2>&1 \ Release-Note: >Audit-Trail: >Unformatted: