add libnss-resolve package, and more nss

Felipe Sateler fsateler at debian.org
Sun Oct 18 23:52:54 BST 2015


I have in branch fsateler/resolve enabled use of libnss-resolve. So
far things are working fine:

- Requests get resolved even when resolved is not running.
- I decided to put resolved before dns, but not replace it just in
case (should postrm fail to remove itself, or a different architecture
program is required).

But.

I have found a problem that is likely to hit all libnss-* packages:
since these modules are loaded by the program making the request, they
need to be installed for all architectures that need to be run. In
practice this will mean amd64 + i386. This raises the following
questions:

1. How to ensure/encourage the user to install the nss modules for all
required architectures? I believe it would be difficult to guess why
some programs work and others don't.
2. nssswitch.conf manipulation needs guards to not happen at removal,
when there is a package installed for another architecture. I have
settled on the following check:

refcount=$(dpkg-query -f '${db:Status-Abbrev} ${binary:Package}\n' \
     -W libnss-resolve | grep '^i' | wc -l)

and check that refcount is 0[1].

There is an environment variable DPKG_MAINTSCRIPT_PACKAGE_REFCOUNT,
but it is not useful because refcount is only decremented at purge,
not removal. I'm a bit unclear on whether the grep should be '^i' or
'^.i', but the results appear to be the same either way.

Thoughts?

-- 

Saludos,
Felipe Sateler

[1] If you are curious, dpkg-query has in my testing resulted in the
following states:

purging amd64 while keeping i386:

pH  libnss-resolve:amd64
ii  libnss-resolve:i386

removing i386 while keeping amd64:

ii  libnss-resolve:amd64
rH  libnss-resolve:i386

Removing both:

rH  libnss-resolve:amd64
ii  libnss-resolve:i386
and then
rc  libnss-resolve:amd64
rH  libnss-resolve:i386

Purging both:

pH  libnss-resolve:amd64
ii  libnss-resolve:i386
and then
un  libnss-resolve:amd64
pH  libnss-resolve:i386



More information about the Pkg-systemd-maintainers mailing list