[PC-BSD Commits] r15792 - in pcbsd/current/src-qt4/warden: bin scripts scripts/backend scripts/rc.d src

svn at pcbsd.org svn at pcbsd.org
Mon Mar 12 14:12:28 PDT 2012


Author: kris
Date: 2012-03-12 21:12:28 +0000 (Mon, 12 Mar 2012)
New Revision: 15792

Modified:
   pcbsd/current/src-qt4/warden/bin/warden
   pcbsd/current/src-qt4/warden/scripts/backend/chrootjail.sh
   pcbsd/current/src-qt4/warden/scripts/backend/createjail.sh
   pcbsd/current/src-qt4/warden/scripts/backend/functions.sh
   pcbsd/current/src-qt4/warden/scripts/backend/importjail.sh
   pcbsd/current/src-qt4/warden/scripts/backend/listjails.sh
   pcbsd/current/src-qt4/warden/scripts/backend/startjail.sh
   pcbsd/current/src-qt4/warden/scripts/backend/stopjail.sh
   pcbsd/current/src-qt4/warden/scripts/managejails.sh
   pcbsd/current/src-qt4/warden/scripts/rc.d/startup.sh
   pcbsd/current/src-qt4/warden/src/dialogwarden.cpp
Log:

Move warden configs to own subdir, now that we have quite a few



Modified: pcbsd/current/src-qt4/warden/bin/warden
===================================================================
--- pcbsd/current/src-qt4/warden/bin/warden	2012-03-12 20:03:56 UTC (rev 15791)
+++ pcbsd/current/src-qt4/warden/bin/warden	2012-03-12 21:12:28 UTC (rev 15792)
@@ -411,10 +411,10 @@
          fi
 
 	 IPS=`echo $EXTRAIPS | sed 's|,| |g'`
-	 rm "${JDIR}/${IP}/etc/.wardenip-extra" >/dev/null 2>/dev/null
+	 rm "${JDIR}/${IP}/etc/warden/ip-extra" >/dev/null 2>/dev/null
 	 for _ip in $IPS
 	 do
-	   echo "$_ip" >> "${JDIR}/${IP}/etc/.wardenip-extra"
+	   echo "$_ip" >> "${JDIR}/${IP}/etc/warden/ip-extra"
 	 done
          ;;
 
@@ -434,7 +434,7 @@
 
 	 case $TYPE in
 	   portjail) mkportjail "${JDIR}/${IP}" ;;
-	   standard) rm ${JDIR}/${IP}/etc/.wardenxjail >/dev/null 2>/dev/null ;;
+	   standard) rm ${JDIR}/${IP}/etc/warden/xjail >/dev/null 2>/dev/null ;;
 	   *) echo "Invalid TYPE" ; exit 1 ;;
          esac
          ;;
@@ -455,12 +455,12 @@
          fi
 
 
-         if [ -e "${JDIR}/${IP}/etc/.wardenautostart" ]
+         if [ -e "${JDIR}/${IP}/etc/warden/autostart" ]
          then
-            rm "${JDIR}/${IP}/etc/.wardenautostart"
+            rm "${JDIR}/${IP}/etc/warden/autostart"
             echo "Disabled autostart for ${IP}"
          else
-            touch "${JDIR}/${IP}/etc/.wardenautostart"
+            touch "${JDIR}/${IP}/etc/warden/autostart"
             echo "Enabled autostart for ${IP}"
          fi 
 

Modified: pcbsd/current/src-qt4/warden/scripts/backend/chrootjail.sh
===================================================================
--- pcbsd/current/src-qt4/warden/scripts/backend/chrootjail.sh	2012-03-12 20:03:56 UTC (rev 15791)
+++ pcbsd/current/src-qt4/warden/scripts/backend/chrootjail.sh	2012-03-12 21:12:28 UTC (rev 15792)
@@ -41,8 +41,8 @@
 JID="`jls | grep ${JDIR}/${IP} | tr -s " " | cut -d " " -f 2`"
 
 # If on an xjail, make display available
-if [ -e "${JDIR}/${IP}/etc/.wardenxjail" ] ; then
-  HOST="`cat ${JDIR}/${IP}/etc/.wardenhost`"
+if [ -e "${JDIR}/${IP}/etc/warden/xjail" ] ; then
+  HOST="`cat ${JDIR}/${IP}/etc/warden/host`"
   xhost + 2>/dev/null >/dev/null
 else
  if [ "`whoami`" != "root" ] ; then

Modified: pcbsd/current/src-qt4/warden/scripts/backend/createjail.sh
===================================================================
--- pcbsd/current/src-qt4/warden/scripts/backend/createjail.sh	2012-03-12 20:03:56 UTC (rev 15791)
+++ pcbsd/current/src-qt4/warden/scripts/backend/createjail.sh	2012-03-12 21:12:28 UTC (rev 15792)
@@ -41,8 +41,9 @@
 tar xvf ${WORLDCHROOT} -C "${JAILDIR}" 2>/dev/null
 echo "Done"
 
-echo "${HOST}" > ${JAILDIR}/etc/.wardenhost
-echo "${IP}" > ${JAILDIR}/etc/.wardenip
+mkdir ${JAILDIR}/etc/warden
+echo "${HOST}" > ${JAILDIR}/etc/warden/host
+echo "${IP}" > ${JAILDIR}/etc/warden/ip
 
 if [ "$SOURCE" = "YES" ]
 then
@@ -99,7 +100,7 @@
 
 if [ "$STARTUP" = "YES" ]
 then
-  touch "${JDIR}/${IP}/etc/.wardenautostart"
+  touch "${JDIR}/${IP}/etc/warden/autostart"
 fi
 
 # Copy over the pbid scripts

Modified: pcbsd/current/src-qt4/warden/scripts/backend/functions.sh
===================================================================
--- pcbsd/current/src-qt4/warden/scripts/backend/functions.sh	2012-03-12 20:03:56 UTC (rev 15791)
+++ pcbsd/current/src-qt4/warden/scripts/backend/functions.sh	2012-03-12 21:12:28 UTC (rev 15792)
@@ -222,7 +222,7 @@
   # Make sure we remove our cleartmp rc.d script, causes issues
   [ -e "${1}/etc/rc.d/cleartmp" ] && rm ${1}/etc/rc.d/cleartmp
   # Flag this type
-  touch ${1}/etc/.wardenxjail
+  touch ${1}/etc/warden/xjail
 }
 
 isV6() {

Modified: pcbsd/current/src-qt4/warden/scripts/backend/importjail.sh
===================================================================
--- pcbsd/current/src-qt4/warden/scripts/backend/importjail.sh	2012-03-12 20:03:56 UTC (rev 15791)
+++ pcbsd/current/src-qt4/warden/scripts/backend/importjail.sh	2012-03-12 21:12:28 UTC (rev 15792)
@@ -150,13 +150,13 @@
 tail +${SKIP} ${IFILE} | lzma -d -c 2>/dev/null | tar xpf - -C "${JDIR}/${IP}" 2>/dev/null
 
 # Make sure we have an IP address saved
-echo "${IP}" >"${JDIR}/${IP}/etc/.wardenip"
+echo "${IP}" >"${JDIR}/${IP}/etc/warden/ip"
 
 # Create the host for this device
 if [ "${HOST}" != "OFF" -a ! -z "${HOST}" ]
 then
   # Save the details to the .wardenhost file
-  echo "${HOST}" >"${JDIR}/${IP}/etc/.wardenhost"
+  echo "${HOST}" >"${JDIR}/${IP}/etc/warden/host"
 
   # Change the hostname in rc.conf
   cat "${JDIR}/${IP}/etc/rc.conf" | grep -v "hostname=" >${JDIR}/${IP}/.rc.conf

Modified: pcbsd/current/src-qt4/warden/scripts/backend/listjails.sh
===================================================================
--- pcbsd/current/src-qt4/warden/scripts/backend/listjails.sh	2012-03-12 20:03:56 UTC (rev 15791)
+++ pcbsd/current/src-qt4/warden/scripts/backend/listjails.sh	2012-03-12 21:12:28 UTC (rev 15792)
@@ -29,18 +29,18 @@
   STATUS="<unknown>"
 
   # Get the HostName
-  if [ -e "${i}/etc/.wardenhost" ]
+  if [ -e "${i}/etc/warden/host" ]
   then
-    HOST="`cat ${i}/etc/.wardenhost`"
+    HOST="`cat ${i}/etc/warden/host`"
   fi
 
   # Check if we are autostarting this jail
-  if [ -e "${i}/etc/.wardenautostart" ] ; then
+  if [ -e "${i}/etc/warden/autostart" ] ; then
     AUTO="Enabled"
   fi
  
   # Figure out the type of jail
-  if [ -e "${i}/etc/.wardenxjail" ] ; then
+  if [ -e "${i}/etc/warden/xjail" ] ; then
     TYPE="portjail"
   else
     TYPE="standard"

Modified: pcbsd/current/src-qt4/warden/scripts/backend/startjail.sh
===================================================================
--- pcbsd/current/src-qt4/warden/scripts/backend/startjail.sh	2012-03-12 20:03:56 UTC (rev 15791)
+++ pcbsd/current/src-qt4/warden/scripts/backend/startjail.sh	2012-03-12 21:12:28 UTC (rev 15792)
@@ -38,18 +38,18 @@
 fi
 
 
-HOST="`cat ${JDIR}/${IP}/etc/.wardenhost`"
+HOST="`cat ${JDIR}/${IP}/etc/warden/host`"
 
 mount -t devfs devfs "${JDIR}/${IP}/dev"
 mount -t procfs proc "${JDIR}/${IP}/proc"
-if [ -e "${JDIR}/${IP}/etc/.wardenxjail" ] ; then mountjailxfs ${IP} ; fi
+if [ -e "${JDIR}/${IP}/etc/warden/xjail" ] ; then mountjailxfs ${IP} ; fi
 
 IPS="${IP}"
-if [ -e "${JDIR}/${IP}/etc/.wardenip-extra" ] ; then
+if [ -e "${JDIR}/${IP}/etc/warden/ip-extra" ] ; then
   while read line
   do
     IPS="${IPS} $line" 
-  done < ${JDIR}/${IP}/etc/.wardenip-extra
+  done < ${JDIR}/${IP}/etc/warden/ip-extra
 fi
 
 # Setup the IPs for this jail

Modified: pcbsd/current/src-qt4/warden/scripts/backend/stopjail.sh
===================================================================
--- pcbsd/current/src-qt4/warden/scripts/backend/stopjail.sh	2012-03-12 20:03:56 UTC (rev 15791)
+++ pcbsd/current/src-qt4/warden/scripts/backend/stopjail.sh	2012-03-12 21:12:28 UTC (rev 15792)
@@ -34,7 +34,7 @@
 fi
 
 
-HOST="`cat ${JDIR}/${IP}/etc/.wardenhost`"
+HOST="`cat ${JDIR}/${IP}/etc/warden/host`"
 
 # Make sure the jail is running
 jls | grep ${JDIR}/${IP} >/dev/null 2>/dev/null
@@ -55,15 +55,15 @@
 echo -e ".\c"
 
 # Check if we need umount x mnts
-if [ -e "${JDIR}/${IP}/etc/.wardenxjail" ] ; then umountjailxfs ${IP} ; fi
+if [ -e "${JDIR}/${IP}/etc/warden/xjail" ] ; then umountjailxfs ${IP} ; fi
 
 # Get list of IPs for this jail
 IPS="${IP}"
-if [ -e "${JDIR}/${IP}/etc/.wardenip-extra" ] ; then
+if [ -e "${JDIR}/${IP}/etc/warden/ip-extra" ] ; then
   while read line
   do
     IPS="${IPS} $line"
-  done < ${JDIR}/${IP}/etc/.wardenip-extra
+  done < ${JDIR}/${IP}/etc/warden/ip-extra
 fi
 
 # Check if we need to remove the IP aliases from this jail

Modified: pcbsd/current/src-qt4/warden/scripts/managejails.sh
===================================================================
--- pcbsd/current/src-qt4/warden/scripts/managejails.sh	2012-03-12 20:03:56 UTC (rev 15791)
+++ pcbsd/current/src-qt4/warden/scripts/managejails.sh	2012-03-12 21:12:28 UTC (rev 15792)
@@ -22,9 +22,9 @@
 cd ${JDIR}
 for i in `ls -d *`
 do
-  if [ -e "${i}/etc/.wardenip" ]
+  if [ -e "${i}/etc/warden/ip" ]
   then
-    AVAILJAILS="${AVAILJAILS} ${i} '`cat ${i}/etc/.wardenhost`' off"
+    AVAILJAILS="${AVAILJAILS} ${i} '`cat ${i}/etc/warden/host`' off"
   fi
 done
 
@@ -42,7 +42,7 @@
 
 # Get the jail IP / Host
 IP="${ANS}"
-HOST="`cat ${JDIR}/${IP}/etc/.wardenhost`"
+HOST="`cat ${JDIR}/${IP}/etc/warden/host`"
 
 # We have a jail to work with, lets bring up some details
 while
@@ -58,7 +58,7 @@
  fi
 
  # Check if this jail autostarts
- if [ -e "${JDIR}/${IP}/etc/.wardenautostart" ]
+ if [ -e "${JDIR}/${IP}/etc/warden/autostart" ]
  then
    AUTOS="Disable Autostart" 
  else
@@ -100,11 +100,11 @@
          ;;
     
     # The user wants to disable / enable autostart
-    auto) if [ -e "${JDIR}/${IP}/etc/.wardenautostart" ]
+    auto) if [ -e "${JDIR}/${IP}/etc/warden/autostart" ]
           then
-             rm "${JDIR}/${IP}/etc/.wardenautostart" 
+             rm "${JDIR}/${IP}/etc/warden/autostart" 
           else
-             touch "${JDIR}/${IP}/etc/.wardenautostart" 
+             touch "${JDIR}/${IP}/etc/warden/autostart" 
           fi ;;
     # The user wants to start / stop this jail
     toggle) if [ "$JTOG2" = "0" ]

Modified: pcbsd/current/src-qt4/warden/scripts/rc.d/startup.sh
===================================================================
--- pcbsd/current/src-qt4/warden/scripts/rc.d/startup.sh	2012-03-12 20:03:56 UTC (rev 15791)
+++ pcbsd/current/src-qt4/warden/scripts/rc.d/startup.sh	2012-03-12 21:12:28 UTC (rev 15792)
@@ -22,7 +22,7 @@
 cd ${JDIR}
 for i in `ls -d *`
 do
-  if [ -e "${i}/etc/.wardenautostart" ]
+  if [ -e "${i}/etc/warden/autostart" ]
   then
    echo -e "Starting Jail (${i})...\c"
    ${PROGDIR}/scripts/backend/startjail.sh "${i}" >/dev/null 2>/dev/null

Modified: pcbsd/current/src-qt4/warden/src/dialogwarden.cpp
===================================================================
--- pcbsd/current/src-qt4/warden/src/dialogwarden.cpp	2012-03-12 20:03:56 UTC (rev 15791)
+++ pcbsd/current/src-qt4/warden/src/dialogwarden.cpp	2012-03-12 21:12:28 UTC (rev 15792)
@@ -89,7 +89,7 @@
        if ( d[i] != "." && d[i] != ".." ) {
 	   
             // Check for the hostname of this jail
-            QFile file( JailDir + "/" + d[i] + "/etc/.wardenhost" );
+            QFile file( JailDir + "/" + d[i] + "/etc/warden/host" );
             if ( file.exists() ) {
 	if ( file.open( QIODevice::ReadOnly ) ) {
 	    QTextStream stream( &file );
@@ -101,7 +101,7 @@
 	    
 	          // Check if this jail is set to autostart
 	          AutoStart = "Disabled";
-	          QFile file2(JailDir + "/" + d[i] + "/etc/.wardenautostart" );
+	          QFile file2(JailDir + "/" + d[i] + "/etc/warden/autostart" );
 	          if ( file2.exists() )
 	          {
 		     AutoStart = "Enabled";  



More information about the Commits mailing list