libnss-{resolve,myhostname} don’t install correctly if previously removed without being purged

Bug #1649370 reported by Anders Kaseorg
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
systemd (Ubuntu)
Won't Fix
Medium
Unassigned

Bug Description

# grep hosts /etc/nsswitch.conf
hosts: files myhostname dns
# apt install libnss-resolve
# grep hosts /etc/nsswitch.conf
hosts: files myhostname resolve [!UNAVAIL=return] dns
# apt remove libnss-resolve
# grep hosts /etc/nsswitch.conf
hosts: files myhostname dns
# apt install libnss-resolve
# grep hosts /etc/nsswitch.conf
hosts: files myhostname dns

libnss-resolve.postinst and libnss-myhostname.postinst only update /etc/nsswitch.conf if [ "$1" = configure ] && [ -z "$2" ]. If the package was previously removed but not purged (it is in the Config-Files state), dpkg passes the previous version as $2, so this fails.

Tags: zesty
Steve Langasek (vorlon)
Changed in systemd (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
James Gove (jamesgove) wrote :

Thanks for the bug fixing.

Dan Streetman (ddstreet)
Changed in systemd (Ubuntu):
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.