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

next in thread | raw e-mail | index | archive | help
--Sig_/5CFyf8dyQTyN94BBWFNSkiW
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_/5CFyf8dyQTyN94BBWFNSkiW
Content-Type: application/pgp-signature
Content-Description: OpenPGP digital signature

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

iQIrBAEBCgAVBQJYF3n7DhxtYXJrQGlvN20uY29tAAoJEAKt2nV+RgR4AyEP/1ug
kV5O9ej0Sc1emZ/Iy6Jedn4iT4rVneFPuRdiLz/F2Qo7qczqjWjNECnvK7AKdr8e
AY5xYHBq/RWeViOHVs8+RGOIQqmgsM7f2YfAeyujU0fKKcR+aAT717giP+4Ee77f
UrKshnSdC6qjWNAa3M0K70yMTPupXwOkLZd6dLPV2L4u/CrQximk5e+mx1ao5uRe
5fDyEAfdZdN4JphC33irs2yaXZA/3oslAGQlfz6eKnhWdLZ2+No8h/HLzGHaqFBo
0Z9EPvzR6L5d9kM0L+WxU+Lg8dr+oonj/GXC+fyjvkvm8tKVI63TxPGWMw1As9If
1OqqgFcS4BKj6hqmuXym8BM2r8EkM+Ar5TUVo/Yj0C4/77r0XC5vc3lWO7gig1WC
cjNhzLcHDil/GCxWJYjNhioeESC6Xpn6EfXS9+/s5RWk5RZ1+3BW0cUlP2OY7srY
CoG2INsMg4yw87LvZErc66BcumyvUHENVApn8Ws7qgTE1ROYYErpMHgW81u8JB4Z
aAVTGy/8AOVoGja7l0sDtx07lKNiNS0Bd4sInvXQ/THWzY9PBi1FRuvl3iYgTMJv
iVOPgb3jw5tp93a0ngWXTUabOXjwHtVNkKdAWzZ2/88xQTORujydk8WFZ6Pd+T5U
FE6x4ebwGXsWUUNowWcKdDJpvgLyT/M9bHDY2omQ
=RTWW
-----END PGP SIGNATURE-----

--Sig_/5CFyf8dyQTyN94BBWFNSkiW--



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