Ignore:
Timestamp:
05/03/13 10:43:08 (15 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2
Children:
460cf4d
Parents:
fda1ea4
Message:

Welcome the new template system to creating jails!

Now you can create jail templates, and then select which template to use
when you create a new jail. Tested it all the way back to FreeBSD 4.1.1 ;)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-sh/warden/scripts/backend/createtemplate.sh

    r411e12f r95952b3  
    100100    fi 
    101101 
     102    # Creating a plugin jail? 
     103    if [ "$TPLUGJAIL" = "YES" ] ; then 
     104      cp /etc/resolv.conf ${TDIR}/etc/resolv.conf 
     105      bootstrap_pkgng "${TDIR}" "pluginjail" 
     106    fi 
     107 
    102108    zfs snapshot ${tank}${zfsp}@clean 
    103109    if [ $? -ne 0 ] ; then exit_err "Failed creating clean ZFS base snapshot"; fi 
     
    117123      cat ${oldStr}.?? | tar --unlink -xpzf - -C ${JDIR}/.templatedir 2>/dev/null 
    118124      cd ${JDIR} 
     125 
     126      # Creating a plugin jail? 
     127      if [ "$TPLUGJAIL" = "YES" ] ; then 
     128        cp /etc/resolv.conf ${JDIR}/.templatedir/etc/resolv.conf 
     129        bootstrap_pkgng "${JDIR}/.templatedir/" "pluginjail" 
     130      fi 
     131 
    119132      echo "Creating template archive..." 
    120133      tar cvjf ${TDIR} -C ${JDIR}/.templatedir 2>/dev/null 
     
    133146      done 
    134147 
     148      # Creating a plugin jail? 
     149      if [ "$TPLUGJAIL" = "YES" ] ; then 
     150        cp /etc/resolv.conf ${JDIR}/.templatedir/etc/resolv.conf 
     151        bootstrap_pkgng "${JDIR}/.templatedir/" "pluginjail" 
     152      fi 
     153 
    135154      echo "Creating template archive..." 
    136155      tar cvjf ${TDIR} -C ${JDIR}/.templatedir 2>/dev/null 
     
    168187           if [ -z "$1" ] ; then exit_err "No nickname specified"; fi 
    169188           TNICK="${1}" 
     189           ;; 
     190 -pluginjail) shift 
     191           TPLUGJAIL="YES" 
    170192           ;; 
    171193        *) exit_err "Invalid option: $1" ;; 
     
    229251create_template 
    230252 
     253exit 0 
Note: See TracChangeset for help on using the changeset viewer.