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

svn at pcbsd.org svn at pcbsd.org
Fri Mar 2 12:16:17 PST 2012


Author: kris
Date: 2012-03-02 20:16:17 +0000 (Fri, 02 Mar 2012)
New Revision: 15680

Removed:
   pcbsd/current/src-qt4/warden/install-repo.sh
Modified:
   pcbsd/current/src-qt4/warden/bin/warden
   pcbsd/current/src-qt4/warden/scripts/backend/createjail.sh
   pcbsd/current/src-qt4/warden/scripts/backend/functions.sh
   pcbsd/current/src-qt4/warden/scripts/rc.d/wardenrc
   pcbsd/current/src-qt4/warden/warden.pro
Log:

When creating warden jail, make PBI commands available with the default warden repo



Modified: pcbsd/current/src-qt4/warden/bin/warden
===================================================================
--- pcbsd/current/src-qt4/warden/bin/warden	2012-03-02 18:36:07 UTC (rev 15679)
+++ pcbsd/current/src-qt4/warden/bin/warden	2012-03-02 20:16:17 UTC (rev 15680)
@@ -36,7 +36,6 @@
 Type in help <command> for infomation and usage about that command
 
   help - This help file
-  menu - Launch the text-based menu
    gui - Launch the GUI menu
 
     auto - Toggles the autostart flag for a jail
@@ -428,9 +427,6 @@
 
          ;;
 
-   menu) require_root
-  	 ${PROGDIR}/scripts/warden.sh ;;
-
     gui) require_root
 	  ${PROGDIR}/bin/warden-gui ;;
 

Modified: pcbsd/current/src-qt4/warden/scripts/backend/createjail.sh
===================================================================
--- pcbsd/current/src-qt4/warden/scripts/backend/createjail.sh	2012-03-02 18:36:07 UTC (rev 15679)
+++ pcbsd/current/src-qt4/warden/scripts/backend/createjail.sh	2012-03-02 20:16:17 UTC (rev 15680)
@@ -95,6 +95,8 @@
   touch "${JDIR}/${IP}/etc/.wardenautostart"
 fi
 
+# Copy over the pbid scripts
+checkpbiscripts "${JDIR}/${IP}"
 
 echo "Success! Jail created at ${JDIR}/${IP}"
 

Modified: pcbsd/current/src-qt4/warden/scripts/backend/functions.sh
===================================================================
--- pcbsd/current/src-qt4/warden/scripts/backend/functions.sh	2012-03-02 18:36:07 UTC (rev 15679)
+++ pcbsd/current/src-qt4/warden/scripts/backend/functions.sh	2012-03-02 20:16:17 UTC (rev 15680)
@@ -167,3 +167,33 @@
   done
   return $status
 }
+
+# Check if PBI scripts are loaded in jail
+checkpbiscripts() {
+  if [ -z "${1}" ] ; then return ; fi
+  if [ ! -e "${1}/usr/local/sbin/pbi_info" ] ; then
+    copypbiscripts "${1}"
+  elif [ "`ls -l /usr/local/sbin/pbi_info | awk '{print $5}'`" != "`ls -l ${1}/usr/local/sbin/pbi_info | awk '{print $5}'`" ] ; then 
+    copypbiscripts "${1}"
+  fi
+}
+
+# Copy PBI scripts to jail
+copypbiscripts() {
+  if [ -z "${1}" ] ; then return ; fi
+  mkdir -p ${1}/usr/local/sbin >/dev/null 2>/dev/null
+  cp /usr/local/sbin/pbi* ${1}/usr/local/sbin/
+  chmod 755 ${1}/usr/local/sbin/pbi*
+
+  # Copy rc.d pbid script
+  mkdir -p ${1}/usr/local/etc/rc.d >/dev/null 2>/dev/null
+  cp /usr/local/etc/rc.d/pbid ${1}/usr/local/etc/rc.d/
+
+  # Install repo in jail
+  if [ ! -e "${1}/var/db/pbi-warden/keys" ] ; then
+     cp ${PROGDIR}/repo/warden-repo.rpo ${1}/
+     chroot ${1} /usr/local/sbin/pbi_addrepo /warden-repo.rpo
+     echo "pbid_enable=\"YES\"" >> ${1}/etc/rc.conf
+     rm ${1}/warden-repo.rpo
+  fi
+}

Modified: pcbsd/current/src-qt4/warden/scripts/rc.d/wardenrc
===================================================================
--- pcbsd/current/src-qt4/warden/scripts/rc.d/wardenrc	2012-03-02 18:36:07 UTC (rev 15679)
+++ pcbsd/current/src-qt4/warden/scripts/rc.d/wardenrc	2012-03-02 20:16:17 UTC (rev 15680)
@@ -11,7 +11,6 @@
 
 stop_cmd="warden_stop"
 start_cmd="warden_start"
-pidfile="/var/run/pbid-warden.pid"
 
 load_rc_config $name
 
@@ -21,24 +20,11 @@
 {
   PROGDIR="/usr/local/share/warden"
   $PROGDIR/scripts/rc.d/startup.sh
-
-  PBI_DBDIR="/var/db/pbi-warden"
-  PBID_LOGFILE="/var/log/pbid-warden.log"
-  PBI_APPDIR="${PBI_DBDIR}/apps"
-  export PBI_DBDIR PBID_LOGFILE PBI_APPDIR
-  (nice pbid) &
-  echo "$!" > ${pidfile}
 }
 
 warden_stop()
 {
   PROGDIR="/usr/local/share/warden"
-  if [ -e "$pidfile" ] ; then
-    echo "Stopping pbid-warden..."
-    kill -9 "`cat ${pidfile}`"
-    rm "${pidfile}"
-  fi
-
   $PROGDIR/scripts/rc.d/shutdown.sh
 }
 

Modified: pcbsd/current/src-qt4/warden/warden.pro
===================================================================
--- pcbsd/current/src-qt4/warden/warden.pro	2012-03-02 18:36:07 UTC (rev 15679)
+++ pcbsd/current/src-qt4/warden/warden.pro	2012-03-02 20:16:17 UTC (rev 15680)
@@ -25,7 +25,7 @@
 rc.path=$${INSTALLDIR}/scripts/rc.d
 rc.extra=ln -fs $${INSTALLDIR}/scripts/rc.d/wardenrc /usr/local/etc/rc.d/wardenrc
 
-dorepo.path=/var/db/pbi-warden/
-dorepo.extra=sh install-repo.sh `pwd`
+cprepo.path=$${INSTALLDIR}/repo
+cprepo.files=repo/*
 
-INSTALLS+= scripts binscript conf binlink mkdirs rc icon dorepo
+INSTALLS+= scripts binscript conf binlink mkdirs rc icon cprepo



More information about the Commits mailing list