On Fri, Jul 22, 2016 at 08:54:05AM +0200, Petter Reinholdtsen wrote: > [Holger Levsen] > > this feels wrong - and I also wonder: if this happens in tests, I > > assume this will happen in the real world too. > > > > Maybe sitesummary needs a pre-depends on apache2 instead? > > > > https://www.debian.org/doc/debian-policy/ch-relationships > > Absolutely. See bug <URL: https://bugs.debian.org/760084 > and the > workarounds we had to implement in Debian Edu to get it working. See > also <URL: https://bugs.debian.org/483997 >. > > A 'fix' would be to change the recommends to depends, but we do not > really want the server package to depend on a web server, as it can do > many interesting things also without the CGI part. Just wondering if this 'works-for-me' workaround (delaying the config part as sort of a pre-depends on apache2) would be acceptable:
diff --git a/debian/sitesummary.postinst b/debian/sitesummary.postinst
index 3401acf..2bb468d 100644
--- a/debian/sitesummary.postinst
+++ b/debian/sitesummary.postinst
@@ -70,17 +70,16 @@ case "$1" in
# Close debconf file handles before restarting Apache
db_stop
- # Enable it on fresh installations as before Apache 2.4. Check for
- # cgi.load existence to avoid trying to configure when installed after
- # apache2 is unpacked but not yet configured (bug #760084).
- if [ -z "$2" ] && \
- [ -e /etc/apache2/mods-available/cgi.load ] && \
- [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
- . /usr/share/apache2/apache2-maintscript-helper
- apache2_invoke enmod cgi.load
- apache2_invoke enconf sitesummary.conf
- fi
-
+ # Enable it on fresh installations as before Apache 2.4, but
+ # delay apache2 configuration for the case both packages are installed
+ # in parallel (workaround for bug #760084).
+ echo "if [ -e /etc/apache2/mods-available/cgi.load ] ; then" >>
/tmp/atfile
+ echo " a2enmod cgi" >> /tmp/atfile
+ echo " a2enconf sitesummary" >> /tmp/atfile
+ echo " service apache2 restart" >> /tmp/atfile
+ echo " rm /tmp/atfile" >> /tmp/atfile
+ echo "fi" >> /tmp/atfile
+ at -f /tmp/atfile now + 3 min
# Make sure the cgi script can write to the storage area
chown www-data /var/lib/sitesummary/tmpstorage \
/var/lib/sitesummary/entries
Wolfgang
signature.asc
Description: Digital signature

