[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ezjail] ezjail + zfs bug
Hi,
On 07/31/13 20:08, Fredrik Eriksson wrote:
I believe attached diff is a fix, but don't take my word for it. ;)
Yeah, I think I touched something I shouldn't have when cleaning up in a
rush, changed that back in attached diff. Also got
cannot open 'fsm/malmoe/m/jails/newjail': dataset does not exist
but I gotta go so I can't investigate that right now. Later or tomorrow.
--
Fredrik
--- ezjail-admin 2013-07-31 19:37:11.000000000 +0200
+++ /usr/local/bin/ezjail-admin 2013-07-31 20:11:50.000000000 +0200
@@ -262,7 +262,7 @@
if [ "${ezjail_use_zfs}" = "YES" ]; then
ensure_jailzfs
- /sbin/zfs create ${ezjail_jailzfs}/basejail
+ /sbin/zfs create -o mountpoint=${ezjail_jaildir}/basejail ${ezjail_jailzfs}/basejail
/sbin/zfs snapshot ${ezjail_jailzfs}/basejail@`date -v -7d +"%C%y%m%d_%H:%M:%S"`
fi
@@ -284,6 +284,7 @@
[ -d "${ezjail_jailtemplate}" ] && zfs destroy -R ${ezjail_jailzfs}/newjail && rm -rf "${ezjail_jailtemplate}"
cd ${ezjail_jaildir}
zfs rename ${ezjail_jailzfs}/fulljail ${ezjail_jailzfs}/newjail
+ zfs set mountpoint=${ezjail_jaildir}/newjail ${ezjail_jailzfs}/newjail
else
[ -d "${ezjail_jailtemplate}" ] && chflags -R noschg "${ezjail_jailtemplate}" && rm -rf "${ezjail_jailtemplate}"
mv "${ezjail_jailfull}" "${ezjail_jailtemplate}"
@@ -432,7 +433,7 @@
_zfs_status=`/sbin/zfs list -H -o name ${ezjail_jailzfs} 2> /dev/null`
[ "${_zfs_status}" = "${ezjail_jailzfs}" ] && return
- # if a directoy already exists in that place, make sure it is empty, else bump user
+ # if a directory already exists in that place, make sure it is empty, else bump user
[ -d "${ezjail_jaildir}" -a -n "`ls -A ${ezjail_jaildir}`" ] && exerr "Error: Can not create zfs at ${ezjail_jaildir}.\n There is a non-empty directory in the way."
# create all parent file systems if necessary
@@ -932,7 +933,7 @@
if [ "${ezjail_use_zfs}" = "YES" ]; then
ensure_jailzfs
[ -d "${ezjail_jailfull}" ] && /sbin/zfs destroy -R "${ezjail_jailzfs}/fulljail" 2>/dev/null && rm -rf "${ezjail_jailfull}"
- /sbin/zfs create "${ezjail_jailzfs}/fulljail" || exerr "Error: Cannot create temporary Jail directory."
+ /sbin/zfs create -o mountpoint="${ezjail_jaildir}/fulljail" "${ezjail_jailzfs}/fulljail" || exerr "Error: Cannot create temporary Jail directory."
else
[ -d "${ezjail_jailfull}" ] && chflags -R noschg "${ezjail_jailfull}" && rm -rf "${ezjail_jailfull}"
mkdir -p "${ezjail_jailfull}" || exerr "Error: Cannot create temporary Jail directory."
@@ -1013,7 +1014,7 @@
if [ "${ezjail_use_zfs}" = "YES" ]; then
ensure_jailzfs
[ -d "${ezjail_jailfull}" ] && /sbin/zfs destroy -R "${ezjail_jailzfs}/fulljail" 2>/dev/null && rm -rf "${ezjail_jailfull}"
- /sbin/zfs create "${ezjail_jailzfs}/fulljail" || exerr "Error: Cannot create temporary Jail directory."
+ /sbin/zfs create -o mountpoint="${ezjail_jaildir}/fulljail" "${ezjail_jailzfs}/fulljail" || exerr "Error: Cannot create temporary Jail directory."
else
[ -d "${ezjail_jailfull}" ] && chflags -R noschg "${ezjail_jailfull}" && rm -rf "${ezjail_jailfull}"
mkdir -p "${ezjail_jailfull}" || exerr "Error: Cannot create temporary Jail directory."