From 8180fe866442df43b44a8132ef3176541c849889 Mon Sep 17 00:00:00 2001 From: Laurent Bonnans Date: Wed, 31 Jul 2019 19:09:53 +0200 Subject: Add bugfix service for old connman to systemd-networkd Signed-off-by: Laurent Bonnans --- .../networkd-dhcp-conf/files/clean-connman-symlink.service | 11 +++++++++++ .../networkd-dhcp-conf/files/resolvconf-clean | 14 ++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 recipes-connectivity/networkd-dhcp-conf/files/clean-connman-symlink.service create mode 100644 recipes-connectivity/networkd-dhcp-conf/files/resolvconf-clean (limited to 'recipes-connectivity/networkd-dhcp-conf/files') diff --git a/recipes-connectivity/networkd-dhcp-conf/files/clean-connman-symlink.service b/recipes-connectivity/networkd-dhcp-conf/files/clean-connman-symlink.service new file mode 100644 index 0000000..8af8263 --- /dev/null +++ b/recipes-connectivity/networkd-dhcp-conf/files/clean-connman-symlink.service @@ -0,0 +1,11 @@ +[Unit] +Description=Clean up bogus symlinked resolv.conf +Before=network-pre.target +Wants=network-pre.target + +[Service] +Type=oneshot +ExecStart=/usr/sbin/resolvconf-clean + +[Install] +WantedBy=multi-user.target diff --git a/recipes-connectivity/networkd-dhcp-conf/files/resolvconf-clean b/recipes-connectivity/networkd-dhcp-conf/files/resolvconf-clean new file mode 100644 index 0000000..89c7e90 --- /dev/null +++ b/recipes-connectivity/networkd-dhcp-conf/files/resolvconf-clean @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +if [ ! -L /etc/resolv.conf ]; then + exit 0 +fi + +# 'readlink -f' will fail if the symlink doesn't resolve to an existing path +if readlink /etc/resolv.conf | grep -q connman; then + echo "Replacing resolv.conf symlink: $(readlink /etc/resolv.conf) to /etc/resolv-conf.systemd" + rm /etc/resolv.conf + ln -s /etc/resolv-conf.systemd /etc/resolv.conf +fi -- cgit v1.2.3-54-g00ecf