From 727191c36d0b5f1cc29cbd99ea21b558ba3bfd31 Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Thu, 17 Dec 2009 17:56:04 -0500 Subject: [PATCH] Pass --no-start to dh_installinit in invirt-dev and run the initscript by hand. This works around a bug where init scripts are started before Python modules have been fully installed. svn path=/trunk/packages/invirt-dev/; revision=2630 --- debian/invirt-dev.postinst | 11 +++++++++-- debian/invirt-dev.prerm | 10 +++++++++- debian/rules | 8 ++++++++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/debian/invirt-dev.postinst b/debian/invirt-dev.postinst index d9b6b9b..7427c1f 100755 --- a/debian/invirt-dev.postinst +++ b/debian/invirt-dev.postinst @@ -20,13 +20,12 @@ case "$1" in mkdir -p /srv/git fi - invirt-build-conf - cat >>/etc/sudoers </dev/null; then + invoke-rc.d invirt-dev start + else + /etc/init.d/invirt-dev start + fi +fi diff --git a/debian/invirt-dev.prerm b/debian/invirt-dev.prerm index 5d8daa3..c86e7d3 100755 --- a/debian/invirt-dev.prerm +++ b/debian/invirt-dev.prerm @@ -19,7 +19,7 @@ set -e case "$1" in remove|upgrade|deconfigure) - perl -i.bak -ne 's%^### (BEGIN|END) invirt-dev\s*$%%m && ($skip = ($1 eq "BEGIN")); print unless $skip;' /etc/sudoers + perl -i.bak -ne 's%^### (BEGIN|END) invirt-dev\s*$%%m && ($skip = ($1 eq "BEGIN")); print unless $skip;' /etc/sudoers ;; failed-upgrade) @@ -31,6 +31,14 @@ case "$1" in ;; esac +if [ -x /etc/init.d/invirt-dev ]; then + if hash invoke-rc.d 2>/dev/null; then + invoke-rc.d invirt-dev stop + else + /etc/init.d/invirt-dev stop + fi +fi + # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. diff --git a/debian/rules b/debian/rules index ef4b266..4bde507 100755 --- a/debian/rules +++ b/debian/rules @@ -2,6 +2,14 @@ DEB_PYTHON_SYSTEM=pysupport +# We use --no-start instead of letting dh_installinit do its thing +# because, in the postinst, dh_installinit's automatically added code +# runs before dh_pysupport's automatically added code. +# +# This means that when the initscript is started, Python modules +# installed by the package haven't been fully installed yet. +DEB_DH_INSTALLINIT_ARGS += --no-start + include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/class/python-distutils.mk -- 1.7.9.5