[Pkg-zenoss-commits] r233 - in /packages/zenoss/trunk/debian: rules zenoss.dh_zenosspostinst zenoss.dirs zenoss.postinst zenoss.prerm

bzed-guest at users.alioth.debian.org bzed-guest at users.alioth.debian.org
Wed Jul 11 16:52:18 UTC 2007


Author: bzed-guest
Date: Wed Jul 11 16:52:18 2007
New Revision: 233

URL: http://svn.debian.org/wsvn/pkg-zenoss/?sc=1&rev=233
Log:
better handling of the zenoss init.
also don't start it before zope is runinng, and stop
it before the ZEO goes down.


Added:
    packages/zenoss/trunk/debian/zenoss.prerm
Removed:
    packages/zenoss/trunk/debian/zenoss.dh_zenosspostinst
Modified:
    packages/zenoss/trunk/debian/rules
    packages/zenoss/trunk/debian/zenoss.dirs
    packages/zenoss/trunk/debian/zenoss.postinst

Modified: packages/zenoss/trunk/debian/rules
URL: http://svn.debian.org/wsvn/pkg-zenoss/packages/zenoss/trunk/debian/rules?rev=233&op=diff
==============================================================================
--- packages/zenoss/trunk/debian/rules (original)
+++ packages/zenoss/trunk/debian/rules Wed Jul 11 16:52:18 2007
@@ -97,6 +97,7 @@
 
 	chmod 755 $(CURDIR)/debian/zenoss/usr/share/zope/Products/ZenUITests/tests/selenium/{t,T}*.py
 	chmod 755 $(CURDIR)/debian/zenoss/usr/share/zope/Products/ZenUtils/ZenBackupBase.py
+	chown zenoss:zenoss $(CURDIR)/debian/zenoss/var/cache/zenoss
 
 binary-arch: build-arch install-arch
 	dh_testdir
@@ -128,10 +129,7 @@
 	dh_compress -i -XZenossAdminGuide2-0.pdf
 	dh_fixperms -i
 	dh_installdebconf -i
-	#this is a kinda not so nice hack,
-	#but we need to populate ZEO before the daemons start.
-	cat $(CURDIR)/debian/zenoss.dh_zenosspostinst >> $(CURDIR)/debian/zenoss.postinst.debhelper
-	dh_installinit -i
+	dh_installinit -i --no-start -u'start 21 3 4 5 . stop 21 0 1 6 .'
 	dh_installdeb -i
 	dh_gencontrol -i
 	dh_md5sums -i

Modified: packages/zenoss/trunk/debian/zenoss.dirs
URL: http://svn.debian.org/wsvn/pkg-zenoss/packages/zenoss/trunk/debian/zenoss.dirs?rev=233&op=diff
==============================================================================
--- packages/zenoss/trunk/debian/zenoss.dirs (original)
+++ packages/zenoss/trunk/debian/zenoss.dirs Wed Jul 11 16:52:18 2007
@@ -1,2 +1,3 @@
 usr/lib/zenoss
 usr/share/dbconfig-common/data/zenoss/install-dbadmin
+var/cache/zenoss

Modified: packages/zenoss/trunk/debian/zenoss.postinst
URL: http://svn.debian.org/wsvn/pkg-zenoss/packages/zenoss/trunk/debian/zenoss.postinst?rev=233&op=diff
==============================================================================
--- packages/zenoss/trunk/debian/zenoss.postinst (original)
+++ packages/zenoss/trunk/debian/zenoss.postinst Wed Jul 11 16:52:18 2007
@@ -30,4 +30,46 @@
 
 #DEBHELPER#
 
+
+db_stop || true
+
+
+if [ "$1" = "configure" ]; then
+  # we're supposed to stop the zope processes to insert the data/migrate
+  dzhandle zopectl zenoss stop
+  if [ -z "$2" ]; then
+    . /etc/dbconfig-common/zenoss.conf
+    if [ -z "$dbc_dbserver" ]; then
+      dbc_dbserver="localhost"
+    fi
+    LOGFILE="$ZENUSERHOME/log/zenbuild_install.log"
+    if [ -f $LOGFILE ]; then
+      mv $LOGFILE $LOGFILE.bak
+    fi
+    echo "Initializing Zenoss: building zentinel portal object and dmd database."
+    echo -n "It might take a while (logging to $LOGFILE) ..."
+    su - "$ZENUSER" -s /bin/bash -c "$ZENUSERHOME/bin/zenbuild -s \"$dbc_dbserver\" -u \"$dbc_dbuser\" -p \"$dbc_dbpass\" -d \"$dbc_dbname\"" &> $LOGFILE
+    echo " done."
+  else
+    LOGFILE="/var/lib/zope$ZOPE_VERSION/instance/zenoss/log/zenmigrate.log"
+      if [ -f $LOGFILE ]; then
+        mv $LOGFILE $LOGFILE.bak
+     fi
+     su - $ZENUSER -s /bin/bash -c "$ZENUSERHOME/bin/zenmigrate run" 1>$LOGFILE 2>&1
+  fi
+  #start the zope instance again
+  dzhandle zopectl zenoss start
+fi
+
+#there're too many reasons why the start could fail,
+#we should handle it better, but this should work for now
+if [ -x "/etc/init.d/zenoss" ]; then
+        if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+                invoke-rc.d zenoss start || true
+        else
+                /etc/init.d/zenoss start || true
+        fi
+fi
+
+
 exit 0

Added: packages/zenoss/trunk/debian/zenoss.prerm
URL: http://svn.debian.org/wsvn/pkg-zenoss/packages/zenoss/trunk/debian/zenoss.prerm?rev=233&op=file
==============================================================================
--- packages/zenoss/trunk/debian/zenoss.prerm (added)
+++ packages/zenoss/trunk/debian/zenoss.prerm Wed Jul 11 16:52:18 2007
@@ -1,0 +1,19 @@
+#!/bin/bash
+
+set -e
+
+
+#stop zenoss daemons first. If we fail, the user needs to fix it.
+#they should not keep running while the ZEO is being shut down.
+
+if [ -x "/etc/init.d/zenoss" ]; then
+        if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+                invoke-rc.d zenoss stop || exit $?
+        else
+                /etc/init.d/zenoss stop || exit $?
+        fi
+fi
+
+#DEBHELPER#
+
+




More information about the Pkg-zenoss-commits mailing list