Package: tt-rss Version: 15.7+git20151123+dfsg-3 Severity: normal Tags: patch
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Dear Maintainer, I encountered a problem that after I purge and re-install, there is no /etc/tt- rss/database.php. The daemon fails to start and the web interface does not work. After a bit of debugging I found that during purge there is 'rm -rf /etc /tt-rss/' but ucf hashes are not being removed by either dbconfig-common or by tt-rss. When the next time the package is installed, ucf does not store the configuration file in the desired location after showing a dialog to override the configuration file. This is happening, for some reason, even when we select 'install package maintainer's version' option in the ucf dialog. The attached patch fixes the problem. It purges the ucf hash during package purge. It can be argued that it is the duty of dbconfig-common to do this and it is really a bug there. Each package will then have to pass generated include file information during postrm operations of dbconfig-common. Another option is for dbconfig-common to store the information about the generated include files and retrieve it during postrm operation. The following is some more information after purge root@freedombox-vm1:~# cat /var/lib/ucf/cache/\:etc\:tt-rss\:database.php <?php ## ## database access settings in php format ## automatically generated from /etc/dbconfig-common/tt-rss.conf ## by /usr/sbin/dbconfig-generate-include ## ## by default this file is managed via ucf, so you shouldn't have to ## worry about manual changes being silently discarded. *however*, ## you'll probably also want to edit the configuration file mentioned ## above too. ## $dbuser='ttrss'; $dbpass='xxxxxxxxx'; $basepath=''; $dbname='ttrss'; $dbserver='localhost'; $dbport=''; $dbtype='pgsql'; root@freedombox-vm1:~# apt-get install tt-rss Reading package lists... Done Building dependency tree Reading state information... Done Suggested packages: sphinxsearch php-apc The following NEW packages will be installed: tt-rss 0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded. Need to get 0 B/873 kB of archives. After this operation, 7,103 kB of additional disk space will be used. Preconfiguring packages ... tt-rss failed to preconfigure, with exit status 2 Selecting previously unselected package tt-rss. (Reading database ... 131188 files and directories currently installed.) Preparing to unpack .../tt-rss_15.7+git20151123+dfsg-3_all.deb ... Unpacking tt-rss (15.7+git20151123+dfsg-3) ... Processing triggers for systemd (229-2) ... Setting up tt-rss (15.7+git20151123+dfsg-3) ... dbconfig-common: writing config to /etc/dbconfig-common/tt-rss.conf Creating config file /etc/dbconfig-common/tt-rss.conf with new version stat: cannot stat '/etc/tt-rss/database.php': No such file or directory creating postgres user ttrss: already exists. resetting password: success. creating database ttrss: already exists. populating database via sql... done. dbconfig-common: flushing administrative password apache2_invoke: Enable configuration 50-tt-rss Processing triggers for systemd (229-2) ... root@freedombox-vm1:~# systemctl status tt-rss ● tt-rss.service - Update the Tiny Tiny RSS subscribed syndication feeds Loaded: loaded (/lib/systemd/system/tt-rss.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Sat 2016-03-12 15:05:17 GMT-3; 3min 57s ago Main PID: 5067 (code=exited, status=255) Mar 12 15:05:16 freedombox-vm1 systemd[1]: Started Update the Tiny Tiny RSS subscribed syndication feeds. Mar 12 15:05:17 freedombox-vm1 update.php[5067]: PHP Warning: include_once(/etc/tt-rss/database.php): failed to open stream: No such file or directory in /etc/tt-rss/config.php on line 6 Mar 12 15:05:17 freedombox-vm1 update.php[5067]: PHP Warning: include_once(): Failed opening '/etc/tt-rss/database.php' for inclusion (include_path='/usr/share/tt-rss/www/include:.:/usr/share/php:') in /etc/tt- rss/config.php on line 6 Mar 12 15:05:17 freedombox-vm1 systemd[1]: tt-rss.service: Main process exited, code=exited, status=255/n/a Mar 12 15:05:17 freedombox-vm1 systemd[1]: tt-rss.service: Unit entered failed state. Mar 12 15:05:17 freedombox-vm1 systemd[1]: tt-rss.service: Failed with result 'exit-code'. - -- System Information: Debian Release: stretch/sid APT prefers unstable APT policy: (500, 'unstable') Architecture: amd64 (x86_64) Foreign Architectures: i386, armhf Kernel: Linux 4.3.0-1-amd64 (SMP w/4 CPU cores) Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJW5AoEAAoJEDbDYUQMm8lx3wMQAIZ1yikEVTvCiK1vfDsl9npg Wj7N1o8RL3vKK04hfsxNcM0uLwGep3mxYNVo5MpfidXCwr02X4THSoDBOaETPvRB 2F6ZMmKiPNI2G3oeybdlQPK4/YKSYYx74IpnbBzwRrRvl+ggk3zq61CZmBTB47Dk KJnft4ge/M6Ye+7mZZjMQTPOftHGEIrIWBbFFvAvEfWssjO2hV8jqX3c9NWFgaRW ZZz5r9ez42HhfmCJaCGh0ihpgfGHq1o9/LL5A3t2o73jlrUjMTKJgIe6KTqsbY02 Py3Z7MVavTVNC1MJ6fWkh1mYaSSjPqdmWTu2pGV1ydO0qLxRI5rG6/N3NcaXplmJ MX1dO1wmY9dAcLOWOJluCC87AkSpLeTe+5Hvlh5/Zk6F/wPr034v0Oh3N7qEFTCF dg7DUjQ7l4u2E2o5+jNG3ROVG4lfPU4E07RljbkeNEUmZM/d83/DNulyIsL5cRud YYtxnlt+L0ur42LjeFrVtffZZieeA8KozAIxxcAKQuWtq4xyhB2JL9jpenlOjiiV /2HSaajsfbdFigMZhN6hBlceWryAS1wRz+c694yLOtUJOFATRmgLC8t6uhCO3RUM koS//YhGJ+67q6wYSiUPhLbXAPOhNGhos5q/O09iEmF3YX1UM3KdASEYl7lw9dZO pt8F8SjMCJWCc06/EJPz =ael9 -----END PGP SIGNATURE-----
>From 24f2b29bc0f95e609fe60490eab547c193708b82 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa <[email protected]> Date: Sat, 12 Mar 2016 17:28:23 +0530 Subject: [PATCH] Remove database include file from ucf on purge Remove database configuration include file from ucf state hashfile. Without this trying to reinstall the package after a purge will not create the database configuration include file. --- debian/postrm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/debian/postrm b/debian/postrm index a207dd7..cdbfe4c 100644 --- a/debian/postrm +++ b/debian/postrm @@ -35,6 +35,11 @@ fi if [ "$1" = "purge" ]; then rm -rf /etc/tt-rss + # Remove database configuration include file from ucf state + # hashfile. Without this trying to reinstall the package + # after a purge will not create the database configuration + # include file. + ucf --purge /etc/tt-rss/database.php fi if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then -- 2.7.0

