From nobody@FreeBSD.org  Sat Apr 12 07:32:22 2014
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTPS id 7896EC70
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 12 Apr 2014 07:32:22 +0000 (UTC)
Received: from cgiserv.freebsd.org (cgiserv.freebsd.org [IPv6:2001:1900:2254:206a::50:4])
	(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 65722174D
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 12 Apr 2014 07:32:22 +0000 (UTC)
Received: from cgiserv.freebsd.org ([127.0.1.6])
	by cgiserv.freebsd.org (8.14.8/8.14.8) with ESMTP id s3C7WLwk002414
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 12 Apr 2014 07:32:21 GMT
	(envelope-from nobody@cgiserv.freebsd.org)
Received: (from nobody@localhost)
	by cgiserv.freebsd.org (8.14.8/8.14.8/Submit) id s3C7WL7w002401;
	Sat, 12 Apr 2014 07:32:21 GMT
	(envelope-from nobody)
Message-Id: <201404120732.s3C7WL7w002401@cgiserv.freebsd.org>
Date: Sat, 12 Apr 2014 07:32:21 GMT
From: Holger Freyther <holger@freyther.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: /etc/rc.d/jail, ezjail and Linux jails don't work with FreeBSD 10.0
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         188495
>Category:       kern
>Synopsis:       [jail] /etc/rc.d/jail, ezjail and Linux jails don't work with FreeBSD 10.0
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-jail
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Apr 12 07:40:00 UTC 2014
>Closed-Date:    
>Last-Modified:  Mon May 05 03:11:35 UTC 2014
>Originator:     Holger Freyther
>Release:        10.0
>Organization:
>Environment:
FreeBSD  10.0-RELEASE-p1 FreeBSD 10.0-RELEASE-p1 #14 5464d00(10-releng)-dirty: Sat Apr 12 05:49:26 UTC 2014
>Description:
I am using ezjail and have a Linux/Debian/Squeeze jail. Starting with
FreeBSD the jail can not be started. In the ezjail config I specify:

  export jail_osmocom_builder_debian_flags="-l -U root"

When executing ezjail the following command will be executed:

/usr/sbin/jail -l -u root -i -f /var/run/jail.osmocom_builder_debian.conf -c osmocom_builder_debian

Passing -l (or -u root) and -f together will generate a non comprehensive
error message of the jail command:

usage: jail [-dhilqv] [-J jid_file] [-u username] [-U username]
            -[cmr] param=value ... [command=command ...]
       jail [-dqv] [-f file] -[cmr] [jail]
       jail [-qv] [-f file] -[rR] ['*' | jail ...]
       jail [-dhilqv] [-J jid_file] [-u username] [-U username]
            [-n jailname] [-s securelevel]
            path hostname [ip[,...]] command ...


When removing the flags the jail command fails in determing the uid/id
of root inside the jail. This is to be understood as the database used
in FreeBSD does not exist in linux.

The only way to get it started is to remove three lines generated by
/etc/rc.d/jail

                echo "  exec.clean;"
                echo "  exec.system_user = \"root\";"
                echo "  exec.jail_user = \"root\";"

Otherwise the command will fail with:

jail: osmocom_builder_debian: getpwnam: No such file or directory
jail: osmocom_builder_debian: sleep 2: failed

>How-To-Repeat:
Attempt to start a non FreeBSD jail.
>Fix:
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-jail 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Mon May 5 03:09:42 UTC 2014 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=188495 
>Unformatted:
