On Thu, Nov 12, 2009 at 10:14:40PM +0100, Christian Perrier wrote:
> Quoting Jonathan Wiltshire (deb...@jwiltshire.org.uk):
> > Hi Christian,
> > 
> > I figured out what was wrong with the postinst in ganglia and it's a tiny
> > patch (below). Is it too late to get it into your delayed NMU?
> 
> OK. Here's the new patch.

It doesn't seem to include the post-rm and -inst scripts, which matter
because the templates have changed. They are attached.


#!/bin/sh

set -e

. /usr/share/debconf/confmodule
db_version 2.0 || [ $? -lt 30 ]

if [ "$1" = "configure" ]; then

    db_get ganglia-webfrontend/webserver
    autoconfigure="$RET"
    webserver="apache2"

    if [ "$autoconfigure" = true ]; then
        test -x /usr/sbin/$webserver || continue

        # Auto-configure module dependencies
        a2enmod php5 || true
        a2enmod cgi || true

        if [ ! -f /etc/$webserver/conf.d/ganglia-webfrontend -a ! -h 
/etc/$webserver/conf.d/ganglia-webfrontend ]; then
            ln -s /etc/ganglia-webfrontend/apache.conf 
/etc/$webserver/conf.d/ganglia-webfrontend
        fi

        # Restart apache2 if requested
        db_get ganglia-webfrontend/restart
        if [ "$RET" = "true" ]; then
            if [ -x /usr/sbin/invoke-rc.d ]; then
                invoke-rc.d $webserver restart || true
            else
                /etc/init.d/$webserver restart || true
            fi
        fi

    fi

fi

#DEBHELPER#
#! /bin/sh

set -e

. /usr/share/debconf/confmodule
db_version 2.0 || [ $? -lt 30 ]

if [ "$1" = "purge" ]; then

    db_get ganglia-webfrontend/webserver || true

    if [ "$RET" = "true" ]; then
        webserver="apache2"

        if [ -h /etc/$webserver/conf.d/ganglia-webfrontend ]; then
            rm -f /etc/$webserver/conf.d/ganglia-webfrontend
        fi

        if [ -x /usr/sbin/$webserver ]; then
            db_reset ganglia-webfrontend/restart
            db_input high ganglia-webfrontend/restart || true
            db_go

            # Restart apache2 if requested
            db_get ganglia-webfrontend/restart
            if [ "$RET" = "true" ]; then
                if [ -x /usr/sbin/invoke-rc.d ]; then
                    invoke-rc.d $webserver restart || true
                else
                    /etc/init.d/$webserver restart || true
                fi
            fi
        fi
    fi

    rmdir --ignore-fail-on-non-empty /etc/ganglia-webfrontend || true

    db_purge

fi

#DEBHELPER#

Reply via email to