[Pkg-zenoss-team] Bug#429722: database removal hooks needed

Stefano Zacchiroli zack at debian.org
Tue Jun 19 18:24:05 UTC 2007


Package: dbconfig-common
Version: 1.8.34
Severity: normal

dbconfig-common now provides hooks for database initial setup and for
database upgrade. It does not provide however hooks to be executed upon
database removal.


I (lucky me) encountered a case in which this is needed, long
description of the case follows. The affected package is zenoss, being
packaged on the alioth project pkg-zenoss.alioth.debian.org. Zenoss is a
network monitoring system which uses MySQL for storing past events
information.

Zenoss uses triggers. Unfortunately the "CREATE TRIGGER" in MySQL does
not offer an "IF NOT EXISTS" modifier (that's because multiple triggers
can coexist, even if they are not working for some reason in default
MySQL Debian installation).  So if the Zenoss package is removed, but
the admin chooses not to purge the database the triggers remain. At that
point, if the admin chooses to install again Zenoss the installation
will fail when trying to create again the triggers.

As a solution to that I can:
- write a non-SQL script that check if the triggers are already present
  before trying to recreate them
- states somewhere that the db must be purged before the package can be
  reinstalled again
- use postrm to manually remove the triggers

As a general solution to this kind of problems however, I think adding
remove hooks might prove do be an useful addition to dbconfig-common.

Thanks for this package, it rocks!
Cheers.

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.21-1-686 (SMP w/1 CPU core)
Locale: LANG=it_IT.UTF-8, LC_CTYPE=it_IT.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages dbconfig-common depends on:
ii  debconf [debconf-2.0]         1.5.13     Debian configuration management sy
ii  ucf                           3.001      Update Configuration File: preserv

dbconfig-common recommends no packages.

-- debconf information:
  dbconfig-common/remote-questions-default: false
  dbconfig-common/pgsql/revertconf: false
  dbconfig-common/internal/skip-preseed: false
  dbconfig-common/db/dbname:
  dbconfig-common/pgsql/manualconf:
  dbconfig-common/dbconfig-remove: true
  dbconfig-common/mysql/method: unix socket
  dbconfig-common/upgrade-backup: true
  dbconfig-common/pgsql/authmethod-admin: ident
  dbconfig-common/upgrade-error: abort
  dbconfig-common/purge: false
  dbconfig-common/db/basepath:
  dbconfig-common/install-error: abort
  dbconfig-common/pgsql/no-empty-passwords:
  dbconfig-common/pgsql/admin-user: postgres
  dbconfig-common/dbconfig-install: true
  dbconfig-common/dbconfig-reinstall: false
  dbconfig-common/remote/host:
  dbconfig-common/pgsql/changeconf: false
  dbconfig-common/remote/newhost:
  dbconfig-common/dbconfig-upgrade: true
  dbconfig-common/pgsql/no-user-choose-other-method:
  dbconfig-common/internal/reconfiguring: false
  dbconfig-common/passwords-do-not-match:
  dbconfig-common/remove-error: abort
  dbconfig-common/remember-admin-pass: false
  dbconfig-common/mysql/admin-user: root
  dbconfig-common/pgsql/method: unix socket
  dbconfig-common/pgsql/authmethod-user:
  dbconfig-common/database-type:
  dbconfig-common/db/app-user:
  dbconfig-common/remote/port:




More information about the Pkg-zenoss-team mailing list