From 2bb48366937bf0d5191be954ea21c671c3722d04 Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Wed, 18 Dec 2013 18:08:34 -0300 Subject: Avoids permanent break of resolv.conf. The resolv.conf file gets updated by resolvconf, maintaining it as a symlink allows the system to reset it during boot time. That is useful when the app has a hard crash that gives no chance to roll back our changes. [Closes #4633] --- changes/bug-4633_fix-resolvconf-usage | 1 + pkg/linux/resolv-update | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 changes/bug-4633_fix-resolvconf-usage diff --git a/changes/bug-4633_fix-resolvconf-usage b/changes/bug-4633_fix-resolvconf-usage new file mode 100644 index 00000000..de40d03a --- /dev/null +++ b/changes/bug-4633_fix-resolvconf-usage @@ -0,0 +1 @@ +- Correct resolvconf usage. Avoids permanent break of resolv.conf. Closes #4633. diff --git a/pkg/linux/resolv-update b/pkg/linux/resolv-update index 601d3bd2..c308b788 100755 --- a/pkg/linux/resolv-update +++ b/pkg/linux/resolv-update @@ -70,7 +70,7 @@ SETVAR R="${R}nameserver $NS " done - mv /etc/resolv.conf /etc/resolv.conf.bak + cp /etc/resolv.conf /etc/resolv.conf.bak echo "$comment $custom_head $R @@ -79,8 +79,8 @@ $custom_tail" > /etc/resolv.conf function down() { if [ -f /etc/resolv.conf.bak ] ; then - unlink /etc/resolv.conf - mv /etc/resolv.conf.bak /etc/resolv.conf + cat /etc/resolv.conf.bak > /etc/resolv.conf + rm /etc/resolv.conf.bak fi } -- cgit v1.2.3