[PC-BSD Commits] r17378 - in pcbsd/current/src-sh/warden: linux-installs scripts/backend

svn at pcbsd.org svn at pcbsd.org
Thu Jun 21 11:49:19 PDT 2012


Author: kris
Date: 2012-06-21 18:49:17 +0000 (Thu, 21 Jun 2012)
New Revision: 17378

Modified:
   pcbsd/current/src-sh/warden/linux-installs/debian-6-squeeze
   pcbsd/current/src-sh/warden/scripts/backend/createjail.sh
   pcbsd/current/src-sh/warden/scripts/backend/startjail.sh
   pcbsd/current/src-sh/warden/scripts/backend/stopjail.sh
Log:

Fix some bugs with different rc styles in linux distros
Improve debian-6-squeeze setup script to replace umount



Modified: pcbsd/current/src-sh/warden/linux-installs/debian-6-squeeze
===================================================================
--- pcbsd/current/src-sh/warden/linux-installs/debian-6-squeeze	2012-06-21 18:10:01 UTC (rev 17377)
+++ pcbsd/current/src-sh/warden/linux-installs/debian-6-squeeze	2012-06-21 18:49:17 UTC (rev 17378)
@@ -17,4 +17,11 @@
 umount -f ${jDIR}/sys >/dev/null 2>/dev/null
 umount -f ${jDIR}/proc >/dev/null 2>/dev/null
 
+# Fix log file
+sed -i '' 's|/dev/xconsole|/var/log/xconsole|g' ${jDIR}/etc/rsyslog.conf
+
+# Get rid of umount
+mv ${jDIR}/sbin/umount ${jDIR}/sbin/umount.prev
+ln -s /bin/true ${jDIR}/sbin/umount
+
 exit $err

Modified: pcbsd/current/src-sh/warden/scripts/backend/createjail.sh
===================================================================
--- pcbsd/current/src-sh/warden/scripts/backend/createjail.sh	2012-06-21 18:10:01 UTC (rev 17377)
+++ pcbsd/current/src-sh/warden/scripts/backend/createjail.sh	2012-06-21 18:49:17 UTC (rev 17378)
@@ -38,15 +38,9 @@
 grpconv
 touch /etc/fstab
 touch /etc/mtab
-cd /sbin
-mv consoletype consoletype.orig
-ln -s /bin/true consoletype
-cd /bin
-mv umount umount.prev
-ln -s /bin/true umount
 ' > ${JDIR}/${IP}/.fixSH
   chmod 755 ${JDIR}/${IP}/.fixSH
-  chroot ${JDIR}/${IP} /.fixSH >/dev/null 2>/dev/null
+  chroot ${JDIR}/${IP} /.fixSH
   rm ${JDIR}/${IP}/.fixSH
 
   # If we are auto-starting the jail, do it now

Modified: pcbsd/current/src-sh/warden/scripts/backend/startjail.sh
===================================================================
--- pcbsd/current/src-sh/warden/scripts/backend/startjail.sh	2012-06-21 18:10:01 UTC (rev 17377)
+++ pcbsd/current/src-sh/warden/scripts/backend/startjail.sh	2012-06-21 18:49:17 UTC (rev 17378)
@@ -100,9 +100,16 @@
 
 jail -c name=${HOST} path=${JDIR}/${IP} host.hostname=${HOST} ${_ipflags} persist
 
+JID="`jls | grep ${JDIR}/${IP} | tr -s " " | cut -d " " -f 2`"
+
 if [ "$LINUXJAIL" = "YES" ] ; then
-  jexec ${HOST} /bin/sh /etc/rc 3 2>&1
+  # Check for different init styles
+  if [ -e "${JDIR}/${IP}/etc/init.d/rc" ] ; then
+    jexec ${JID} /bin/sh /etc/init.d/rc 3 2>&1
+  elif [ -e "${JDIR}/${IP}/etc/rc" ] ; then
+    jexec ${JID} /bin/sh /etc/rc 3 2>&1
+  fi
 else
-  jexec ${HOST} /bin/sh /etc/rc 2>&1
+  jexec ${JID} /bin/sh /etc/rc 2>&1
 fi
 

Modified: pcbsd/current/src-sh/warden/scripts/backend/stopjail.sh
===================================================================
--- pcbsd/current/src-sh/warden/scripts/backend/stopjail.sh	2012-06-21 18:10:01 UTC (rev 17377)
+++ pcbsd/current/src-sh/warden/scripts/backend/stopjail.sh	2012-06-21 18:49:17 UTC (rev 17378)
@@ -85,7 +85,12 @@
 if [ -e "${JMETADIR}/linuxjail" ] ; then LINUXJAIL="YES" ; fi
 
 if [ "$LINUXJAIL" = "YES" ] ; then
-  jexec ${JID} /bin/sh /etc/rc.d/rc 0 >/dev/null 2>/dev/null
+  # Check for different init styles
+  if [ -e "${JDIR}/${IP}/etc/init.d/rc" ] ; then
+    jexec ${JID} /bin/sh /etc/init.d/rc 0 2>&1
+  elif [ -e "${JDIR}/${IP}/etc/rc" ] ; then
+    jexec ${JID} /bin/sh /etc/rc 0 2>&1
+  fi
 else
   jexec ${JID} /bin/sh /etc/rc.shutdown >/dev/null 2>/dev/null
 fi



More information about the Commits mailing list