[PC-BSD Commits] r15679 - pcbsd/current/src-qt4/warden/scripts/rc.d

svn at pcbsd.org svn at pcbsd.org
Fri Mar 2 10:36:08 PST 2012


Author: kris
Date: 2012-03-02 18:36:07 +0000 (Fri, 02 Mar 2012)
New Revision: 15679

Modified:
   pcbsd/current/src-qt4/warden/scripts/rc.d/wardenrc
Log:

Start a pbid instance for the warden PBIs



Modified: pcbsd/current/src-qt4/warden/scripts/rc.d/wardenrc
===================================================================
--- pcbsd/current/src-qt4/warden/scripts/rc.d/wardenrc	2012-03-02 18:21:38 UTC (rev 15678)
+++ pcbsd/current/src-qt4/warden/scripts/rc.d/wardenrc	2012-03-02 18:36:07 UTC (rev 15679)
@@ -11,6 +11,7 @@
 
 stop_cmd="warden_stop"
 start_cmd="warden_start"
+pidfile="/var/run/pbid-warden.pid"
 
 load_rc_config $name
 
@@ -20,11 +21,24 @@
 {
   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
 }
 



More information about the Commits mailing list