[PC-BSD Commits] r15669 - in pcbsd/current/src-qt4/warden: bin scripts/backend

svn at pcbsd.org svn at pcbsd.org
Thu Mar 1 16:22:16 PST 2012


Author: kris
Date: 2012-03-02 00:22:15 +0000 (Fri, 02 Mar 2012)
New Revision: 15669

Modified:
   pcbsd/current/src-qt4/warden/bin/warden
   pcbsd/current/src-qt4/warden/scripts/backend/chrootjail.sh
   pcbsd/current/src-qt4/warden/scripts/backend/stopjail.sh
Log:

Fix a bug stopping jail, and setting type



Modified: pcbsd/current/src-qt4/warden/bin/warden
===================================================================
--- pcbsd/current/src-qt4/warden/bin/warden	2012-03-01 18:11:36 UTC (rev 15668)
+++ pcbsd/current/src-qt4/warden/bin/warden	2012-03-02 00:22:15 UTC (rev 15669)
@@ -395,21 +395,6 @@
                      [ -e "${JDIR}/${IP}/etc/rc.d/cleartmp" ] && rm ${JDIR}/${IP}/etc/rc.d/cleartmp
 		     # Flag this type
 		     touch ${JDIR}/${IP}/etc/.wardenxjail
-	             # Add the hostname to the portjails /etc/hosts file, to prevent sendmail warnings
-		     PJHOST="$(hostname)"
-                     if [ -e ${JDIR}/${IP}/etc/hosts ]; then
-                        sed -i -e '/^127.0.0.1.*/d' ${JDIR}/${IP}/etc/hosts
-                        sed -i -e '/^::1.*/d' ${JDIR}/${IP}/etc/hosts
-                     fi
-                     echo "::1             localhost localhost.my.domain ${PJHOST}" >>${JDIR}/${IP}/etc/hosts
-                     echo "127.0.0.1       localhost localhost.my.domain ${PJHOST}" >>${JDIR}/${IP}/etc/hosts
-
-  		     # Make sure the /etc/rc.conf HOSTNAME values match
-		     cat ${JDIR}/${IP}/etc/rc.conf | grep -v "hostname=" > /tmp/.rc.$$
-		     echo "$PJHOST" > ${JDIR}/${IP}/etc/.wardenhost
-		     echo "hostname=$PJHOST" > ${JDIR}/${IP}/etc/rc.conf
-		     cat /tmp/.rc.$$ >> ${JDIR}/${IP}/etc/rc.conf
-		     rm /tmp/.rc.$$
                      ;;
 	   standard) rm ${JDIR}/${IP}/etc/.wardenxjail >/dev/null 2>/dev/null ;;
 	   *) echo "Invalid TYPE" ; exit 1 ;;

Modified: pcbsd/current/src-qt4/warden/scripts/backend/chrootjail.sh
===================================================================
--- pcbsd/current/src-qt4/warden/scripts/backend/chrootjail.sh	2012-03-01 18:11:36 UTC (rev 15668)
+++ pcbsd/current/src-qt4/warden/scripts/backend/chrootjail.sh	2012-03-02 00:22:15 UTC (rev 15669)
@@ -42,6 +42,7 @@
 
 # If on an xjail, make display available
 if [ -e "${JDIR}/${IP}/etc/.wardenxjail" ] ; then
+  HOST="`cat ${JDIR}/${IP}/etc/.wardenhost`"
   xhost + 2>/dev/null >/dev/null
 fi
 
@@ -49,7 +50,7 @@
 ###################################################################
 
 if [ -z "$2" ] ; then
-  echo 'Started shell session on ${IP}. Type exit when finished.'
+  echo "Started shell session on ${IP}. Type exit when finished."
   jailme ${JID} /bin/csh
 else
   jailme ${JID} "${2}"

Modified: pcbsd/current/src-qt4/warden/scripts/backend/stopjail.sh
===================================================================
--- pcbsd/current/src-qt4/warden/scripts/backend/stopjail.sh	2012-03-01 18:11:36 UTC (rev 15668)
+++ pcbsd/current/src-qt4/warden/scripts/backend/stopjail.sh	2012-03-02 00:22:15 UTC (rev 15669)
@@ -126,6 +126,7 @@
 
 echo -e ".\c"
 
+jail -r ${JID}
 rm ${JDIR}/${IP}/var/run/warden.jid 2>/dev/null
 
 echo -e "Done"



More information about the Commits mailing list