#966138 Package: connman sysvint script disables DNS lookups when resolvconf package installed

Package:
connman
Source:
connman
Description:
Intel Connection Manager daemon
Submitter:
Vernon Van Steenkist
Date:
2021-07-30 10:36:03 UTC
Severity:
normal
#966138#5
Date:
2020-07-23 15:39:54 UTC
From:
To:
Beowulf connman 1.36-2 i386 sysvinit script conflicts with resolvconf 1.79 package leaving the system in a state unable to do DNS lookups.

Problem one:

sed -n "22,25p" /etc/init.d/connman

if [ "CONNMAN_RUNSTATEDIR_RESOLVCONF" != "no" ] ; then
     mkdir -p /run/connman
     ln -sf /run/connman/resolv.conf /etc/
fi

Since string CONNMAN_RUNSTATEDIR_RESOLVCONF will never be equal to string no, the following line will always be executed
ln -sf /run/connman/resolv.conf /etc/


So, I am not what conditional

if [ "CONNMAN_RUNSTATEDIR_RESOLVCONF" != "no" ]

is supposed to accomplish.

Problem Two:

This creates a problem when using the resolvconf package. Package resolvconf links /etc/resolv.conf to
/run/resolvconf/resolv.conf However, after re-boot, /etc/init.d/connman overwrites this link and links
/etc/resolv.conf to /run/connman/resolv.conf
once again leaving the system in a state unable to do DNS look-ups.

I have brute forced a fix by commenting out the line
ln -sf /run/connman/resolv.conf /etc/ in /etc/init.d/connman

sed -n "22,25p" /etc/init.d/connman

if [ "CONNMAN_RUNSTATEDIR_RESOLVCONF" != "no" ] ; then
     mkdir -p /run/connman
#    ln -sf /run/connman/resolv.conf /etc/
fi

and re-linking /etc/resolv.conf to /run/resolvconf/resolv.conf

I am not sure what the correct fix should be.

Please don't hesitate to contact me if you have any questions.

Thanks,
Vernon

#966138#10
Date:
2020-07-26 19:04:38 UTC
From:
To:
I don't use connman, but I was intrigued by this bug, so I replaced
ifupdown in a VM with connman.

1) connman is taking over the resolv.conf symlink because it provides
an inbuilt dns caching server and assumes that the user wants to use
it by default.

2) The package could ship "/etc/default/connman" with
"CONNMAN_RUNSTATEDIR_RESOLVCONF=no" to reverse the current sysvrc
default. It would then diverge from the systemd default, whose service
unit doesn't source "/etc/default/connman" and sets up the resolv.conf
symlink via "[/usr]/lib/tmpfiles.d/connman_resolvconf.conf".

#966138#15
Date:
2020-11-28 19:18:48 UTC
From:
To:
There is a typo in the init script, a "$" is missing to expand the variable:

if [ "CONNMAN_RUNSTATEDIR_RESOLVCONF" != "no" ] ; then

Should be:

if [ "$CONNMAN_RUNSTATEDIR_RESOLVCONF" != "no" ] ; then

Once fixed, create /etc/default/connman:

echo " CONNMAN_RUNSTATEDIR_RESOLVCONF=no" > /etc/default/connman

Regards
--
Pelayo González
1.79 package leaving the system in a state unable to do DNS lookups.
no, the following line will always be executed
resolvconf links /etc/resolv.conf to
overwrites this link and links

#966138#20
Date:
2021-07-30 10:32:48 UTC
From:
To:
As the reply above, the solution is to convert the string into a variable
call, so that the change to /etc/default/connman can be properly processed.

Please, someone with powers, add the fix to
debian/patches/01-init-script-lsb-headers.patch
<https://salsa.debian.org/debian/connman/-/blob/debian/sid/debian/patches/01-init-script-lsb-headers.patch>.
I would also like to request to anyone with powers to package thee fix when
you have time after the bullseye release if not sooner.

These would be the changes to said file, in case the petition is not
understood:
https://gitlab.com/nXecure/connman/-/commit/d5d43713977a5317c84b620251f3cdf2848598f2#8ec1dbece58825f4fe44c11e357d1993f9e23d81

Thanks for your time.