Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Apr 2014 07:32:21 GMT
From:      Holger Freyther <holger@freyther.de>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/188495: /etc/rc.d/jail, ezjail and Linux jails don't work with FreeBSD 10.0
Message-ID:  <201404120732.s3C7WL7w002401@cgiserv.freebsd.org>
Resent-Message-ID: <201404120740.s3C7e03N050391@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         188495
>Category:       misc
>Synopsis:       /etc/rc.d/jail, ezjail and Linux jails don't work with FreeBSD 10.0
>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:   Sat Apr 12 07:40:00 UTC 2014
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201404120732.s3C7WL7w002401>