[Dbconfig-common-devel] Re: Package fails to remove database on postgresql

Michael Ablassmeier abi at grinser.de
Tue Sep 19 09:41:58 UTC 2006


hi again,

On Fri, Sep 15, 2006 at 10:02:29AM +0200, Michael Ablassmeier wrote:
> im currently working on implementing postgreSQL support in one of my
> packages. One problem i have faced is: the Package fails to deconfigure
> the database if the username used for Postgresql user is the same as the
> local system user created by the package.

hm.. Running dbconfig-common with dbc_debug 1 says:

 dbconfig-common: dropping pgsql database zabbix.
 su -s /bin/sh postgres -c "env
  HOME='/tmp/dbconfig-common.psql_home.yr5562'
  PGPASSFILE='/tmp/dbconfig-common.psql_home.yr5562/.pgpass'
  PGSSLMODE='prefer' psql --set "ON_ERROR_STOP=1" -q -U 'postgres'
  template1" 2>&1.
  dropping database zabbix: su -s /bin/sh postgres -c "env
  HOME='/tmp/dbconfig-common.psql_home.bH5594'
  PGPASSFILE='/tmp/dbconfig-common.psql_home.bH5594/.pgpass'
  PGSSLMODE='prefer' dropdb -q -U 'postgres' zabbix" 2>&1.
 does not exist.
  
i really dont get why it fails to remove the database and its user,
running the same command from above by hand, it successfully drops the
database:

 kida:/home/abi/deb/build-area# su -s /bin/sh postgres -c "env
  HOME='/tmp/dbconfig-common.psql_home.bH5594'
  PGPASSFILE='/tmp/dbconfig-common.psql_home.bH5594/.pgpass'
  PGSSLMODE='prefer' dropdb -q -U 'postgres' zabbix"
 kida:/home/abi/deb/build-area# 

i really dont get whats going wrong here. Attached you can find the
complete debug output. I can also provide the package's source if you
guys want to reproduce it.

bye,
    - michael
-------------- next part --------------
kida:/home/abi/deb/build-area# dpkg --purge zabbix-server-pgsql
(Reading database ... 158019 files and directories currently installed.)
Removing zabbix-server-pgsql ...
(prerm) dbc_go() zabbix-server-pgsql remove.
dbc_config() zabbix-server-pgsql remove.
dbc_set_dbtype_defaults().
dbc_read_package_config().
dbc_set_dbtype_defaults() pgsql.
dbconfig-common: dumping pgsql database zabbix to /var/tmp/zabbix-server-pgsql.zabbix.2006-09-19-11.34.pgsql.lx5522.
su -s /bin/sh postgres -c "env HOME='/tmp/dbconfig-common.psql_home.uK5527' PGPASSFILE='/tmp/dbconfig-common.psql_home.uK5527/.pgpass' PGSSLMODE='prefer' psql --set "ON_ERROR_STOP=1" -q -U 'postgres' template1" 2>&1.
su -s /bin/sh postgres -c "env HOME='/tmp/dbconfig-common.psql_home.bU5545' PGPASSFILE='/tmp/dbconfig-common.psql_home.bU5545/.pgpass' PGSSLMODE='prefer' pg_dump -U 'postgres' zabbix" 2>&1.
dbconfig-common: dropping pgsql database zabbix.
su -s /bin/sh postgres -c "env HOME='/tmp/dbconfig-common.psql_home.yr5562' PGPASSFILE='/tmp/dbconfig-common.psql_home.yr5562/.pgpass' PGSSLMODE='prefer' psql --set "ON_ERROR_STOP=1" -q -U 'postgres' template1" 2>&1.
dropping database zabbix: su -s /bin/sh postgres -c "env HOME='/tmp/dbconfig-common.psql_home.bH5594' PGPASSFILE='/tmp/dbconfig-common.psql_home.bH5594/.pgpass' PGSSLMODE='prefer' dropdb -q -U 'postgres' zabbix" 2>&1.
does not exist.
dbconfig-common: revoking privileges for user zabbix on zabbix.
su -s /bin/sh postgres -c "env HOME='/tmp/dbconfig-common.psql_home.Pp5611' PGPASSFILE='/tmp/dbconfig-common.psql_home.Pp5611/.pgpass' PGSSLMODE='prefer' psql --set "ON_ERROR_STOP=1" -q -U 'postgres' template1" 2>&1.
revoking access to database zabbix from zabbix at localhost: su -s /bin/sh postgres -c "env HOME='/tmp/dbconfig-common.psql_home.Na5629' PGPASSFILE='/tmp/dbconfig-common.psql_home.Na5629/.pgpass' PGSSLMODE='prefer' psql --set "ON_ERROR_STOP=1" -q -U 'postgres' template1" 2>&1.
failed.
Stopping Zabbix server: zabbix_server
(postrm) dbc_go() zabbix-server-pgsql remove.
dbc_config() zabbix-server-pgsql remove.
dbc_set_dbtype_defaults().
Purging configuration files for zabbix-server-pgsql ...
(postrm) dbc_go() zabbix-server-pgsql purge.
dbc_config() zabbix-server-pgsql purge.
dbc_set_dbtype_defaults().


More information about the Dbconfig-common-devel mailing list