[Pkg-utopia-maintainers] Bug#813803: Bug#813803: Bug#813803: network-manager: Network-manager update to 1.1.90-4 in unstable broken if resolvconf enabled

Giacomo Mulas giacomo.mulas84 at gmail.com
Sat Feb 6 09:14:54 UTC 2016


On Fri, 5 Feb 2016, Michael Biebl wrote:

> As you can see, resolvconf returns a non-zero exit code, even though it
> apparently has properly updated /etc/resolv.conf
> That non-zero exit code is generated afaics, because resolvconf tries to
> restart non-existing services and propagates that error to the caller.
> It should handle that more carefully.
> This is a bug in openresolv. I'm therefor cloning this bug report and
> reassign it to openresolv.

Thanks Michael.

I looked a bit more into it, and I found that apparently it
is possible to disable individual openresolv subscribers and/or to tell
openresolv what is the name of a service to be restarted in the
configuration file. I _think_ I carefully set it up now so that it only
tries to restart existing services, and with the appropriate names (e.g.
bind9 for named in my case).
Therefore, the problem appears to be in openresolv shipping a default
configuration which is almost always broken, that requires considerable
tinkering to make it work properly (which I had done), and even more 
tinkering to also make it return the appropriate exit code (which was not at
all apparent until network manager broke due to it).
Also, the way return codes are concocted and returned by resolvconf is not
properly documented as far as I can tell. Return codes are never mentioned
in the resolvconf man page.

I suggest that resolvconf, upon installation, open a debconf window asking
the user which subscribers (s)he wants enabled, enabling only those and 
disabling the others. At very least, it should give a very visible warning
upon installation telling the user that hand configuration is required, and
which man pages and files have to be edited. Some examples for common
configurations would be helpful.

Also, I set up a custom script in /etc/NetworkManager/dispatcher.d/ that
sets up configurations for e.g.  smtp servers, print servers etc.  for each
connection.  It would be a really welcome improvement to Network Manager
and/or resolvconf if this could be made easier for the end user.  I attach
my Network Manager dispatcher script as an example.  This would be more like
a wishlist bug on either Network Manager or resolvconf, or both. Or you
could place a simplified version of the custom script in 
/usr/share/doc/networkmanager so that people know how to replicate this.
The best way to implement it would probably be with NetworkManager offering
package managers of services a simple way of dropping a script in
dispatcher.d and setting up environment variables with the
connection-dependent information they need to set up things (like e.g.
NM_SMTPSERVER=example.debian.org ...). Of course, if connection-dependent 
authentication credentials are necessary, a safer method for passing them to
the service should be devised than passing them in env variables available
to anyone. I set up smtp auth credentials in the exim configuration file
/etc/exim/passwd.client, for example, and they are available only to the
root user and Debian-exim group.
Anyway, just a suggestion to think about.

Thanks, bye
Giacomo

-- 
_________________________________________________________________

Giacomo Mulas <gmulas at oa-cagliari.inaf.it>
_________________________________________________________________

INAF - Osservatorio Astronomico di Cagliari
via della scienza 5 - 09047 Selargius (CA)

tel.   +39 070 71180244
mob. : +39 329  6603810
_________________________________________________________________

"When the storms are raging around you, stay right where you are"
                          (Freddy Mercury)
_________________________________________________________________
-------------- next part --------------
#!/bin/sh -e
# Script to dispatch NetworkManager events
#
# Runs ifupdown scripts when NetworkManager fiddles with interfaces.
# See NetworkManager(8) for further documentation of the dispatcher events.

if [ -z "$1" ]; then
    echo "$0: called with no interface" 1>&2
    exit 1;
fi

# Fake ifupdown environment
export IFACE="$1"
export LOGICAL="$1"
export ADDRFAM="NetworkManager"
export METHOD="NetworkManager"
export VERBOSITY="0"

# Run the right scripts
case "$2" in
    up|vpn-up)
	case "$CONNECTION_UUID" in
	    af7e7a64-2e4e-486d-a581-90347dd93dcc|02c5d61b-980f-4ce9-b17c-6e690eea9454)
		cp /etc/exim4/update-exim4.conf.conf-dsf /etc/exim4/update-exim4.conf.conf
		update-exim4.conf
		/etc/init.d/exim4 reload
		cp /etc/cups/cups-browsed.conf-default /etc/cups/cups-browsed.conf
		systemctl try-restart cups-browsed
		lpadmin -d HP_Color_LaserJet_3000
		;;
	    8b8dc31f-bc42-44ce-9e7f-0209b5a70aa7)
		cp /etc/exim4/update-exim4.conf.conf-oac /etc/exim4/update-exim4.conf.conf
		update-exim4.conf
		/etc/init.d/exim4 reload
		cp /etc/cups/cups-browsed.conf-default /etc/cups/cups-browsed.conf
		systemctl try-restart cups-browsed
		lpadmin -d phaser8570
		;;
	    9071c6ec-3af7-49fc-ab7f-e13362a64008)
		cp /etc/exim4/update-exim4.conf.conf-oac /etc/exim4/update-exim4.conf.conf
		update-exim4.conf
		/etc/init.d/exim4 reload
		cp /etc/cups/cups-browsed.conf-default /etc/cups/cups-browsed.conf
		systemctl try-restart cups-browsed
		lpadmin -d phaser8570
		;;
	    ce160ab9-424e-4a66-819a-294d43ff3c9e)
		cp /etc/exim4/update-exim4.conf.conf-oac /etc/exim4/update-exim4.conf.conf
		update-exim4.conf
		/etc/init.d/exim4 reload
		cp /etc/cups/cups-browsed.conf-default /etc/cups/cups-browsed.conf
		systemctl try-restart cups-browsed
		lpadmin -d phaser8570
		;;
	    07627064-f4ef-47b9-9ca2-f3654bf2cf57)
		cp /etc/exim4/update-exim4.conf.conf-tiscali /etc/exim4/update-exim4.conf.conf
		update-exim4.conf
		/etc/init.d/exim4 reload
		cp /etc/cups/cups-browsed.conf-pirri /etc/cups/cups-browsed.conf
		systemctl try-restart cups-browsed
		lpadmin -d HP-Officejet-Pro-8620 || true
		;;
#	    57e6db8d-ed81-4b8f-9222-b4585cd70550)
#		cp /etc/exim4/update-exim4.conf.conf-tim.it /etc/exim4/update-exim4.conf.conf
#		update-exim4.conf
#		/etc/init.d/exim4 reload
#		;;
	    ad537533-92f4-4d8b-ae31-eedbe5c1e758)
		cp /etc/exim4/update-exim4.conf.conf-univie /etc/exim4/update-exim4.conf.conf
		update-exim4.conf
		/etc/init.d/exim4 reload
		cp /etc/cups/cups-browsed.conf-default /etc/cups/cups-browsed.conf
		systemctl try-restart cups-browsed
		;;
	    f4d175a8-e976-4bee-ab74-a3963e0ec613)
		cp /etc/exim4/update-exim4.conf.conf-univie /etc/exim4/update-exim4.conf.conf
		update-exim4.conf
		/etc/init.d/exim4 reload
		cp /etc/cups/cups-browsed.conf-default /etc/cups/cups-browsed.conf
		systemctl try-restart cups-browsed
		;;
	    68da463e-54fb-4486-b9d9-5926edd85aeb)
		cp /etc/exim4/update-exim4.conf.conf-gmail /etc/exim4/update-exim4.conf.conf
#		cp /etc/exim4/update-exim4.conf.conf-cesr /etc/exim4/update-exim4.conf.conf
		update-exim4.conf
		/etc/init.d/exim4 reload
		cp /etc/cups/cups-browsed.conf-default /etc/cups/cups-browsed.conf
		systemctl try-restart cups-browsed
		;;
	    cf992d0d-cad6-4487-8561-be99b23d12de)
		cp /etc/exim4/update-exim4.conf.conf-IRAP /etc/exim4/update-exim4.conf.conf
#		cp /etc/exim4/update-exim4.conf.conf-gmail /etc/exim4/update-exim4.conf.conf
#		cp /etc/exim4/update-exim4.conf.conf-cesr /etc/exim4/update-exim4.conf.conf
		update-exim4.conf
		/etc/init.d/exim4 reload
		cp /etc/cups/cups-browsed.conf-IRAP /etc/cups/cups-browsed.conf
		systemctl try-restart cups-browsed
		;;
	    613c626c-780b-45ae-ac2a-0d04cef79a30)
#		echo "dhcp gives smtp server $DHCP_SMTP_SERVER" >/root/miozio
		cp /etc/exim4/update-exim4.conf.conf-u-psud /etc/exim4/update-exim4.conf.conf
		update-exim4.conf
		/etc/init.d/exim4 reload
		cp /etc/cups/cups-browsed.conf-default /etc/cups/cups-browsed.conf
		systemctl try-restart cups-browsed
		;;
	    faaa49ad-b6e1-4dfc-adbf-d9eabec0ab79)
#		echo "dhcp gives smtp server $DHCP_SMTP_SERVER" >/root/miozio
		cp /etc/exim4/update-exim4.conf.conf-u-psud /etc/exim4/update-exim4.conf.conf
		update-exim4.conf
		/etc/init.d/exim4 reload
		cp /etc/cups/cups-browsed.conf-default /etc/cups/cups-browsed.conf
		systemctl try-restart cups-browsed
		;;
	    7877a80b-a1c0-4ad1-9ecf-eec44650c16c)
		#echo "dhcp gives smtp server $DHCP_SMTP_SERVER" >/root/miozio
		cp /etc/exim4/update-exim4.conf.conf-proxad /etc/exim4/update-exim4.conf.conf
		update-exim4.conf
		/etc/init.d/exim4 reload
		cp /etc/cups/cups-browsed.conf-default /etc/cups/cups-browsed.conf
		systemctl try-restart cups-browsed
		;;
	    *)
		if [ -n "$DHCP_SMTP_SERVER" ] ; then
		    echo "dhcp gives smtp server $DHCP_SMTP_SERVER" >/root/miozio
		fi
		cp /etc/exim4/update-exim4.conf.conf-gmail /etc/exim4/update-exim4.conf.conf
		update-exim4.conf
		/etc/init.d/exim4 reload
		cp /etc/cups/cups-browsed.conf-default /etc/cups/cups-browsed.conf
		systemctl try-restart cups-browsed
	    	# do nothing else
	    	;;
	    esac
	;;
    *)
	# do nothing
	;;
esac


More information about the Pkg-utopia-maintainers mailing list