Update resolv.conf handling to properly support /run (see issue984).
[grml-live.git] / etc / grml / fai / grml / grml_cleanup_chroot
index 2ad900b..074e60e 100755 (executable)
@@ -306,10 +306,17 @@ fi
 
 # installation of resolvconf in chroot *with* /proc
 # is different from an installation without /proc,
 
 # installation of resolvconf in chroot *with* /proc
 # is different from an installation without /proc,
-# so make sure it is OK in any case; don't use /dev/shm
+# so make sure it is OK in any case
 if [ -d /etc/resolvconf ] ; then
 if [ -d /etc/resolvconf ] ; then
-   rm -rf /etc/resolvconf/run
-   mkdir /etc/resolvconf/run
+  if [ -L /etc/resolvconf/run ] ; then # resolvconf with /run
+    # /etc/resolvconf/run symlinks to /run/resolvconf
+    rm -rf /run/resolvconf
+    mkdir -p /run/resolvconf
+  else # no /run present
+    rm -rf /etc/resolvconf/run
+    mkdir /etc/resolvconf/run
+  fi
+
    touch /etc/resolvconf/run/enable-updates
    mkdir /etc/resolvconf/run/interface
    cat > /etc/resolvconf/run/resolv.conf << EOF
    touch /etc/resolvconf/run/enable-updates
    mkdir /etc/resolvconf/run/interface
    cat > /etc/resolvconf/run/resolv.conf << EOF