Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 Oct 2016 17:03:45 +0000
From:      io7m+org.freebsd.jail@mail.io7m.com
To:        freebsd-jail@freebsd.org
Subject:   Jail fails to unmount a directory
Message-ID:  <20161031170345.6f2f88e6@copperhead.int.arc7.info>

next in thread | raw e-mail | index | archive | help
--Sig_/tEiBWb13DSlxZ/NqvtQyKwe
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

Hello.

I have an incredibly trivial jail setup:

/usr/jail/com.example.service0 is the root of the jail.=20
/usr/jail/com.example.service0/base is an empty directory.
/usr/jail/base is a directory containing binaries.

I use the following jail configuration:

com_example_service0
{
  exec.start     =3D "/bin/sh";
  host.hostname  =3D com.example.service0;
  interface      =3D em0;
  ip4.addr       =3D 127.0.0.2;
  mount.fstab    =3D /usr/jail/com.example.service0.fstab;
  path           =3D /usr/jail/com.example.service0;
}

The /usr/jail/com.example.service0.fstab contains a single line:

/usr/jail/base /usr/jail/com.example.service0/base nullfs ro,noauto 0 0

I start the jail:

host# jail -v -f com.example.service0.conf -c com_example_service0
com_example_service0: run command: /sbin/ifconfig em0 inet 127.0.0.2 netmas=
k 255.255.255.255 alias
com_example_service0: run command: /sbin/mount -t nullfs -o ro,noauto /usr/=
jail/base /usr/jail/com.example.service0/base
com_example_service0: jail_set(JAIL_CREATE) persist name=3Dcom_example_serv=
ice0 host.hostname=3Dcom.example.service0 ip4.addr=3D127.0.0.2 path=3D/usr/=
jail/com.example.service0
com_example_service0: created
com_example_service0: run command in jail: /bin/sh
# exit
com_example_service0: jail_set(JAIL_UPDATE) jid=3D13 nopersist
host#

The jail is gone:

host# jls
   JID  IP Address      Hostname                      Path

However:

host# df -h | grep service0
# df -h               =20
Filesystem                         Size    Used   Avail Capacity  Mounted on
zroot/ROOT/default                  13G    475M     13G     4%    /
devfs                              1.0K    1.0K      0B   100%    /dev
zroot/tmp                           13G    108K     13G     0%    /tmp
zroot/usr/home                      13G    136K     13G     0%    /usr/home
zroot/usr/ports                     13G     96K     13G     0%    /usr/ports
zroot/usr/src                       13G     96K     13G     0%    /usr/src
zroot/var/audit                     13G     96K     13G     0%    /var/audit
zroot/var/crash                     13G     96K     13G     0%    /var/crash
zroot/var/log                       13G    148K     13G     0%    /var/log
zroot/var/mail                      13G     96K     13G     0%    /var/mail
zroot/var/tmp                       13G     96K     13G     0%    /var/tmp
zroot                               13G     96K     13G     0%    /zroot
zroot/jail                          13G    249M     13G     2%    /usr/jail
zroot/jail/com.example.service0     13G    4.0M     13G     0%    /usr/jail=
/com.example.service0
/usr/jail/base                      13G    249M     13G     2%    /usr/jail=
/com.example.service0/base

.. the /usr/jail/com.example.service0/base directory was not unmounted.

What do I need to do to get the directory to be correctly unmounted
when the jail ceases to exist?

M

--Sig_/tEiBWb13DSlxZ/NqvtQyKwe
Content-Type: application/pgp-signature
Content-Description: OpenPGP digital signature

-----BEGIN PGP SIGNATURE-----

iQIrBAEBCgAVBQJYF3lxDhxtYXJrQGlvN20uY29tAAoJEAKt2nV+RgR4/tsP/0Cy
k746r8VNtDvaaQHMjpYy/gFUq8ROunNWHMlLTThGqfUXh/7lsJvTFSqnOZ4ysi/w
UGay7lrEs02MCnNTChI8xpd3IsMbKC3nEfXKTji+i/txuQHOnTcy6xcXRxUhDnBY
oYrFrmIrXExkTj/SZ2gzTlUYRAMG30SP8w04hF/1xa3gpm3dnEjT99ktroiRBngv
k8GkRytTZnqLp9p5midEYZXgQjiLTpAKZss4lP0KQK5951U/ILVbPrvoP3THVncz
eCmu4V4NCoS/hb5elJXoCNNnPb8o0BkSyJwKwlAJmhd2CUSQ2sMUM3K7qZY0O8C9
ZXvizzDCpIJSO3GSGWvpN7VzQaQB6ooSJohzRN4xOmoFjEUHpmP101G3PRonlmba
yiF5ZlOa9u0/jr247LeEg0ikz8szDCDiu2sJx08/zoj72QscyodVKufLdbLpC4yP
ZldE2eZmTpOHZzIx5KenJtljOOHcUYl5tlyp9pm63C2ocui4k97oWLW6aJY1LUBV
pZQMc6UGiNgXq9HZYLKt1TlyeCLPlHzaP+eib4ts8xC3uoylP/yqse699l6nRguE
Mv1v6pMsHbr6sr8uxfjd16LX/n80Xl9krQ+ZhB8CaVY+dSkacI8sOpv6rLPl8J3l
nhf0CFtBq5CmuSN/WbLlxY9Gfjwfl0bC+/rPU12T
=dY5R
-----END PGP SIGNATURE-----

--Sig_/tEiBWb13DSlxZ/NqvtQyKwe--



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