Bug 188495

Summary: [jail] /etc/rc.d/jail, ezjail and Linux jails don't work with FreeBSD 10.0
Product: Base System Reporter: holger
Component: kernAssignee: Bugmeister <bugmeister>
Status: Closed Overcome By Events    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description holger 2014-04-12 08:40:00 UTC
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.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2014-05-05 04:09:42 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-jail

Over to maintainer(s).
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:01:45 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped
Comment 3 Mark Linimon freebsd_committer freebsd_triage 2025-01-25 07:24:27 UTC
^Triage: I'm sorry that this PR did not get addressed in a timely fashion.

By now, the version that it was created against is long out of support.
Please re-open if it is still a problem on a supported version.