[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to troubleshoot conffile files problems



Hi Tong,

Replying since I am CC'ed, look below :-

On 12/11/21 10:20 PM, Tong Sun wrote:
Thanks, one more thing,

The dbab can upgrade from oldstable (Buster) just fine, but I'm trying
to remove the conffile files no longer exist since then
(dbab_1.3.2-2),

|  If the conffile has not been shipped for several versions, and you
are now modifying the maintainer scripts to clean up the obsolete
file, prior-version should be based on the version of the package that
you are now preparing, not the first version of the package that
lacked the conffile.

So I did this:

$ cat debian/dbab.maintscript
rm_conffile /etc/dnsmasq.d/dbab.adblock.conf 1.5.7-2~
rm_conffile /etc/dnsmasq.d/dbab.trashsites.conf 1.5.7-2~
rm_conffile /etc/dbab/dbab.proxy 1.5.7-2~

However, when I installed my 1.5.7-2 built such a way, I found the
above files are still there.

For me, the /etc/dbab/dbab.proxy *did* get removed, and the rest two are still present.
Logs pasted at the end of this email.
This is kinda expected I think.

The reason is because "/etc/dbab/dbab.proxy" is present with the package installation in buster, and
the rest two files are created during the postinst script. As far as I read the code, please see here[1] rm_conffile
will work only when the config file belongs to the package, which is not "established" in this case.

In buster version,

$ dpkg -S /etc/dnsmasq.d/dbab.*
dpkg-query: no path found matching pattern /etc/dnsmasq.d/dbab.adblock.conf
dpkg-query: no path found matching pattern /etc/dnsmasq.d/dbab.trashsites.conf

$ dpkg -S /etc/dbab/dbab.proxy
dbab: /etc/dbab/dbab.proxy

So I think you will have to manually take care of these two in postinst, I am not sure
if there is a better way.

[1]: https://sources.debian.org/src/dpkg/1.21.1/scripts/dpkg-maintscript-helper.sh/?hl=29#L98

Regards,
Nilesh

$ apt policy dbab
dbab:
  Installed: 1.3.2-2
  Candidate: 1.5.7-1
  Version table:
     1.5.7-1 500
        500 http://deb.debian.org/debian sid/main amd64 Packages
 *** 1.3.2-2 100
        100 /var/lib/dpkg/status

$ sudo dpkg -i ./dbab_1.5.7-2_all.deb
(Reading database ... 254432 files and directories currently installed.)
Preparing to unpack ./dbab_1.5.7-2_all.deb ...
Unpacking dbab (1.5.7-2) over (1.3.2-2) ...
Setting up dbab (1.5.7-2) ...
Installing new version of config file /etc/dbab/dbab.list+ ...
curl 'https://pgl.yoyo.org/adservers/serverlist.php?hostformat=dnsmasq&showintro=0&mimetype=plaintext' -o /tmp/dbab-map.adblock.conf
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  127k    0  127k    0     0   150k      0 --:--:-- --:--:-- --:--:--  150k
File /etc/dnsmasq.d/dbab-map.adblock.conf updated.
File /etc/dnsmasq.d/dbab-map.trashsites.conf updated.
Removing obsolete conffile /etc/dbab/dbab.proxy ...
Processing triggers for man-db (2.9.4-2) ...

$ ls -la /etc/dnsmasq.d/dbab.trashsites.conf /etc/dnsmasq.d/dbab.adblock.conf /etc/dbab/dbab.proxy
ls: cannot access '/etc/dbab/dbab.proxy': No such file or directory
-rw-r--r-- 1 root root 365 Dec 11 18:04 /etc/dnsmasq.d/dbab.adblock.conf
-rw-r--r-- 1 root root 124 Dec 11 18:04 /etc/dnsmasq.d/dbab.trashsites.conf

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


Reply to: