Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Mar 2012 12:26:42 +0300
From:      Beeblebrox <zaphod@berentweb.com>
To:        freebsd-fs@freebsd.org
Subject:   unionfs: strange error when mounted in jail.
Message-ID:  <CAPSTskuCmQ7%2BLMiu4jpi%2B-xhejwYxY%2BP_xQ6-p8Vi%2BJNVO1Hug@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
I am using ezjail to setup some jailed services. Ezjail sets up a
light-jail and a base(fat)-jail which is mounted "ro" under the light-jail.
I modified this to experiment with an idea. In addition to the standard
mount_nullfs ezjail does, I placed in /etc/fstab.pxe:
> > /data/jails/base/usr/local    /data/jails/pxe/usr/local    unionfs
rw,below,noatime,copymode=masquerade 0 0
> > /data/jails/base/var/db/pkg    /data/jails/pxe/var/db/pkg   unionfs
rw,below,noatime,copymode=masquerade 0 0
What this does, is it allows to create a "base ports" fat-jail where all
"base ports" will be included in subsequently created thin-jails, not as
copy but as a unionfs layer. When updating ports in the jails, the "base
ports" package will have to be updated only once, instead of repeated
update for each thin-jail. I also have zfs dedup=on for the /data/jails
folder.

I install jail-specific ports into the thin-jail by normal process -> start
the jail normally & pkg_add. I then shut-down jail, modify the jail's fstab
(fstab.pxe) and re-start jail.
The problem I run into: Start the jail, then #jexec into jailed env.
Execute an app or service like portmaster (installed into /data/jails/base)
or dhcpd installed into /data/jails/pxe) portmaster will start-up, but
hangs after a short run. dhcpd hangs and freezes the jail immediately - I
cannot kill any of the processes and have to do a poweroff. Both
executables run normally without the unionfs structure.

Regards.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPSTskuCmQ7%2BLMiu4jpi%2B-xhejwYxY%2BP_xQ6-p8Vi%2BJNVO1Hug>