Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Nov 2019 09:35:26 -0800
From:      David Christensen <dpchrist@holgerdanske.com>
To:        freebsd-questions@freebsd.org
Subject:   ezjail Starting jails timeout and WARNING: Per-jail configuration via jail_* variables is obsolete...
Message-ID:  <deb08045-f50f-419d-01f0-38f4723c74e8@holgerdanske.com>

next in thread | raw e-mail | index | archive | help
freebsd-questions:

I have a FreeBSD system:

root@soho2:~ # freebsd-version ; uname -a
11.3-RELEASE-p5
FreeBSD soho2.tracy.holgerdanske.com 11.3-RELEASE-p5 FreeBSD 
11.3-RELEASE-p5 #0: Tue Nov 12 08:59:04 UTC 2019 
root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64


I am attempting to use ezjail:

http://erdgeist.org/arts/software/ezjail/


I am also referring to some additional resources:

https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails.html

man 8 jail

man 7 ezjail

man 8 ezjail-admin

man 5 ezjail.conf

https://nostarch.com/absfreebsd3


I limited listening ports on the host:

     # sockstat -46l
     USER     COMMAND    PID   FD PROTO  LOCAL ADDRESS         FOREIGN 
ADDRESS
     root     sendmail   751   3  tcp4   127.0.0.1:25          *:*
     root     sshd       744   3  tcp4   192.168.5.11:22       *:*
     _ntp     ntpd       713   6  udp4   192.168.5.11:123      *:*
     root     syslogd    544   6  udp4   192.168.5.11:514      *:*


I configured the system to add aliases to the primary network interface 
at boot:

     # grep alias /etc/rc.conf
     ifconfig_igb0_alias0="inet 192.168.5.100 netmask 255.255.255.255"
     ifconfig_igb0_alias1="inet 192.168.5.101 netmask 255.255.255.255"
     ifconfig_igb0_alias2="inet 192.168.5.102 netmask 255.255.255.255"
     ifconfig_igb0_alias3="inet 192.168.5.103 netmask 255.255.255.255"


I configured the system to clone the loopback interface at boot:

     # grep cloned_interfaces /etc/rc.conf
     cloned_interfaces="lo1"


I rebooted.


I installed ezjail from ports:

     # cd /usr/ports/sysutils/ezjail
     # make install clean


I configured ezjail:

     # egrep '^[^#].' /usr/local/etc/ezjail.conf
     ezjail_ftphost=http://ftp.freebsd.org
     ezjail_use_zfs="YES"
     ezjail_use_zfs_for_jails="YES"
     ezjail_jailzfs="soho2_zroot/ezjail"


I enabled ezjail at boot:

     # grep ezjail /etc/rc.conf
     ezjail_enable="YES"


I started the ezjail service:

     # service ezjail start
      ezjail


I performed the ezjail initial setup:

     # ezjail-admin install -p


I created a test jail:

     # ezjail-admin create testjail 'lo1|127.0.1.1,igb0|192.168.5.100'

     # cat /usr/local/etc/ezjail/testjail
     # To specify the start up order of your ezjails, use these lines to
     # create a Jail dependency tree. See rcorder(8) for more details.
     #
     # PROVIDE: standard_ezjail
     # REQUIRE:
     # BEFORE:
     #

     export jail_testjail_hostname="testjail"
     export jail_testjail_ip="lo1|127.0.1.1,igb0|192.168.5.100"
     export jail_testjail_rootdir="/usr/jails/testjail"
     export jail_testjail_exec_start="/bin/sh /etc/rc"
     export jail_testjail_exec_stop=""
     export jail_testjail_mount_enable="YES"
     export jail_testjail_devfs_enable="YES"
     export jail_testjail_devfs_ruleset="devfsrules_jail"
     export jail_testjail_procfs_enable="YES"
     export jail_testjail_fdescfs_enable="YES"
     export jail_testjail_image=""
     export jail_testjail_imagetype="zfs"
     export jail_testjail_attachparams=""
     export jail_testjail_attachblocking=""
     export jail_testjail_forceblocking=""
     export jail_testjail_zfs_datasets=""
     export jail_testjail_cpuset=""
     export jail_testjail_fib=""
     export jail_testjail_parentzfs="soho2_zroot/ezjail"
     export jail_testjail_parameters="allow.raw_sockets=1"
     export jail_testjail_post_start_script=""
     export jail_testjail_retention_policy=""


I started the jail:

     # ezjail-admin start testjail
     Starting jails: testjail.
     /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* 
variables  is obsolete.  Please consider migrating to /etc/jail.conf.


Any ideas about the warning?


I started a console in the jail, looked around, set the root password, 
set timezone, create /etc/resolv.conf, created /etc/rc.conf, etc., and 
logged out:

     # ezjail-admin console testjail
     FreeBSD 11.3-RELEASE-p5 (GENERIC) #0: Tue Nov 12 08:59:04 UTC 2019

     Welcome to FreeBSD!
     <snip>


I stopped the jail:

     # ezjail-admin stop testjail
     Stopping jails: testjail.


When I reboot, I see:

      ezjaileval: 
jail_testjail-20191128-120605_exec_start=-20191128-120605_exec_start: 
not found
      Warning: root directory -20191128-120605_rootdir of 
testjail-20181128-120605 does not exist.
     Starting jails:


Boot hangs after "Starting jails", then times out after 1+ minute:

      testjail.
     /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* 
variables is obsolete.  Please consider migrating to /etc/jail.conf.


Any ideas why the system hangs at boot when starting jails?


TIA,

David



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?deb08045-f50f-419d-01f0-38f4723c74e8>