Skip to content

Commit

Permalink
Fix jail template migrations
Browse files Browse the repository at this point in the history
- Finally found the /mnt/mnt issue
- Looks like the output of "file" changed just enoug in 9.3 to piss off
  the template system to always force migrations, fixed!

Ticket: #10408
  • Loading branch information
John Hixson committed Jul 1, 2015
1 parent b2c6265 commit 5c49283
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/freenas/etc/ix.rc.d/ix-warden
Expand Up @@ -123,6 +123,8 @@ migrate_warden_templates()
local template
local ta
local tv
local pool
local altroot

template="${jc_path}/.warden-template-${t}"
if [ ! -d "${template}" ]
Expand Down Expand Up @@ -152,6 +154,12 @@ migrate_warden_templates()
newmp="${jc_path}/.warden-template-${t}-${tv}-${ta}-${timestr}"
fi

pool="$(echo "${jc_dataset}"|cut -f1 -d '/')"
if [ -n "${pool}" ]
then
altroot="$(zpool get -H altroot "${pool}"|awk '{ print $3 }')"
fi

_w zfs set mountpoint='none' "${template}"
if [ "$?" != "0" ]
then
Expand All @@ -170,6 +178,11 @@ migrate_warden_templates()
continue
fi

if [ -n "${altroot}" ]
then
newmp="${newmp##${altroot}}"
fi

_w zfs set mountpoint="${newmp}" "${newt}"
if [ "$?" != "0" ]
then
Expand All @@ -191,8 +204,7 @@ get_tv()
fi

sysctl_path="${path}/sbin/sysctl"

version="$(file -b "${sysctl_path}"|cut -d ',' -f 5|awk '{ print $3 }')"
version="$(file -b "${sysctl_path}"|cut -d ',' -f 6|awk '{ print $3 }')"
if [ -n "${version}" ]
then
echo "${version}"
Expand Down

0 comments on commit 5c49283

Please sign in to comment.