Changeset e50ac20


Ignore:
Timestamp:
04/17/13 08:09:04 (20 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, 9.1-release, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3, releng/10.1
Children:
89ee0d8, 5cb55b5
Parents:
29c3581
Message:

Add support to warden CLI for editing and using a custom 'fstab'
for each jail. Will allow us to setup nullfs mounts, among others

Location:
src-sh/warden
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src-sh/warden/bin/warden

    r1620346 re50ac20  
    3838Type in help <command> for information and usage about that command 
    3939 
    40   help - This help file" 
     40         help - This help file" 
    4141 
    4242if [ -e "${PROGDIR}/bin/warden-gui" ] ; then 
    43    echo "   gui - Launch the GUI menu" 
     43   echo "          gui - Launch the GUI menu" 
    4444fi 
    4545 
     
    5353       delete - Deletes a jail 
    5454       export - Exports a jail to a .wdn file 
     55        fstab - Start users \$EDITOR on jails custom fstab 
    5556          get - Gets options list for a jail 
    5657       import - Imports a jail from a .wdn file 
     
    465466}; 
    466467 
     468help_fstab() 
     469{ 
     470 title 
     471 echo "Help fstab 
     472 
     473Runs the users \$EDITOR on the jails custom fstab file. Can be used to setup 
     474nullfs mounts and others for a specific jail 
     475 
     476Usage: 
     477 
     478  warden fstab [hosts] 
     479" 
     480}; 
     481 
    467482help_import() 
    468483{ 
     
    615630           list) help_list ;; 
    616631           export) help_export ;; 
     632           fstab) help_fstab ;; 
    617633           import) help_import ;; 
    618634           pkgs) help_pkgs ;; 
     
    653669 
    654670         ${PROGDIR}/scripts/backend/listpbis.sh "${JAILNAME}"  
     671         ;; 
     672    fstab) JAILNAME="${2}" 
     673         if [ -z "${JAILNAME}" ]; then exit_err "No jail specified!"; fi 
     674         if [ ! -e "${JDIR}/${JAILNAME}" ]; then exit_err "No such jail!"; fi 
     675         set_warden_metadir 
     676         if [ ! -e "${JMETADIR}/fstab" ] ; then 
     677            echo "# Device      Mountpoint      FStype          Options Dump Pass" > ${JMETADIR}/fstab 
     678         fi 
     679         if [ -z "$EDITOR" ]; then EDITOR="vi"; fi 
     680         $EDITOR ${JMETADIR}/fstab 
     681         exit $? 
    655682         ;; 
    656683    get) require_root 
  • src-sh/warden/scripts/backend/startjail.sh

    r1620346 re50ac20  
    140140 
    141141  if [ -e "${JMETADIR}/jail-portjail" ] ; then mountjailxfs ${JAILNAME} ; fi 
     142fi 
     143 
     144# Check for user-supplied mounts 
     145if [ -e "${JMETADIR}/fstab" ] ; then 
     146   echo "Mounting user-supplied file-systems" 
     147   mount -a -F ${JMETADIR}/fstab 
    142148fi 
    143149 
  • src-sh/warden/scripts/backend/stopjail.sh

    r1620346 re50ac20  
    5555 
    5656if [ -e "${JMETADIR}/jail-linux" ] ; then LINUXJAIL="YES" ; fi 
     57 
     58# Check for user-supplied mounts 
     59if [ -e "${JMETADIR}/fstab" ] ; then 
     60   echo "Unmounting user-supplied file-systems" 
     61   umount -a -F ${JMETADIR}/fstab 
     62fi 
    5763 
    5864if [ "$LINUXJAIL" = "YES" ] ; then 
Note: See TracChangeset for help on using the changeset viewer.