Dear All,
I'm maintaining fail2ban package and got a bug report about garbage left
after purge on the package. The problem lies in prerm script which first
tries to stop fail2ban and then if stop was successfull removes .py[co]
files (added by dh_python) which were compiled/installed on first
start of fail2ban:
#!/bin/sh
set -e
# Automatically added by dh_installinit
if [ -x "/etc/init.d/fail2ban" ]; then
if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
invoke-rc.d fail2ban stop || exit 0
else
/etc/init.d/fail2ban stop || exit 0
fi
fi
# End automatically added section
# Automatically added by dh_python
dpkg -L fail2ban |
awk '$0~/\.py$/ {print $0"c\n" $0"o"}' |
xargs rm -f >&2
# End automatically added section
The simplest solution is to override error-handler for dh_installinit
but that will impact postinst script as well and I don't want to have
such side effect. What would be a proper solution or do I have to
contact debhelper team (or -dev list) to resolve this case.
I would like to avoid hacking my own prerm since it will not be a proper
solution
Thank you in advance for the hints
----- Forwarded message from Jochen Voss <voss@debian.org> -----
Date: Thu, 03 Nov 2005 11:29:15 +0000
From: Jochen Voss <voss@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: Bug#337223: fail2ban: leaves garbage around after purge
X-Spam-Level:
Package: fail2ban
Version: 0.5.4-7
Severity: normal
Hi,
when I install and then purge fail2ban, some files are left lying around in
/usr/share/fail2ban:
voss@tarte [~] sudo aptitude purge fail2ban
Reading package lists... Done
Building dependency tree... Done
Reading extended state information
Initializing package states... Done
Reading task descriptions... Done
The following packages will be REMOVED:
fail2ban
0 packages upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
Need to get 0B of archives. After unpacking 246kB will be freed.
Do you want to continue? [Y/n/?] y
Writing extended state information... Done
(Reading database ... 132413 files and directories currently installed.)
Removing fail2ban ...
Stopping fail2ban: Status of fail2ban: fail2ban is not running.
Not stopping fail2ban
invoke-rc.d: initscript fail2ban, action "stop" failed.
Purging configuration files for fail2ban ...
dpkg - warning: while removing fail2ban, directory `/usr/share/fail2ban/utils' not empty so not removed.
dpkg - warning: while removing fail2ban, directory `/usr/share/fail2ban/confreader' not empty so not removed.
dpkg - warning: while removing fail2ban, directory `/usr/share/fail2ban/logreader' not empty so not removed.
dpkg - warning: while removing fail2ban, directory `/usr/share/fail2ban/firewall' not empty so not removed.
dpkg - warning: while removing fail2ban, directory `/usr/share/fail2ban' not empty so not removed.
Reading package lists... Done
Building dependency tree... Done
Reading extended state information
Initializing package states... Done
Reading task descriptions... Done
voss@tarte [~] ll /usr/share/fail2ban/
total 56
drwxr-xr-x 2 root root 4096 2005-11-03 11:23 confreader/
-rw-r--r-- 1 root root 15916 2005-11-03 11:14 fail2ban.pyc
-rw-r--r-- 1 root root 15916 2005-11-03 11:14 fail2ban.pyo
drwxr-xr-x 2 root root 4096 2005-11-03 11:23 firewall/
drwxr-xr-x 2 root root 4096 2005-11-03 11:23 logreader/
drwxr-xr-x 2 root root 4096 2005-11-03 11:23 utils/
-rw-r--r-- 1 root root 469 2005-11-03 11:14 version.pyc
-rw-r--r-- 1 root root 469 2005-11-03 11:14 version.pyo
These files should be deleted when the package is purged.
I hope this helps,
Jochen
-- System Information:
Debian Release: testing/unstable
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.14
Locale: LANG=en_GB, LC_CTYPE=en_GB (charmap=ISO-8859-1)
Versions of packages fail2ban depends on:
ii iptables 1.3.3-2 Linux kernel 2.4+ iptables adminis
ii python 2.3.5-3 An interactive high-level object-o
fail2ban recommends no packages.
-- no debconf information
----- End forwarded message -----
--
.-.
=------------------------------ /v\ ----------------------------=
Keep in touch // \\ (yoh@|www.)onerussian.com
Yaroslav Halchenko /( )\ ICQ#: 60653192
Linux User ^^-^^ [175555]
Attachment:
pgpcqIMjztNOM.pgp
Description: PGP signature