Skip to content

dh_installnss: Add debhelper to inject NSS services into `/etc/nsswitch.conf`

Gioele Barabucci requested to merge gioele/debhelper:dh-installnss into main

Adding services to a NSS database in /etc/nsswitch.conf is hard to get right in maintscripts because the NSS configuration file could have been changed not only by other maintscripts, but also manually by the user.

Various packages in Debian (libnss-mdns, libnss-systemd, libnss-ldapd, etc.) rely on an hodge-podge of copy-pasted shell and Perl scripts that fail to handle many edge cases of /etc/nsswitch.conf or that need dpkg-related fixes (e.g., support for DPKG_ROOT).

The dh_installnss debhelper streamlines provides a declarative way to express which services should be installed and in which order.

It also provides a centralized repository of mainscript snippets to ease future changes across NSS-related packages.

Merge request reports

Loading