[bind/f17] initscript: don't umount /var/named when didn't mount it

Adam Tkac atkac at fedoraproject.org
Thu Apr 26 11:34:44 UTC 2012


commit 773ac2b8b36f1011207d5de13b5c5b1ccea98686
Author: Adam Tkac <atkac at redhat.com>
Date:   Thu Apr 26 13:34:29 2012 +0200

    initscript: don't umount /var/named when didn't mount it
    
    Signed-off-by: Adam Tkac <atkac at redhat.com>

 bind.spec             |    5 ++++-
 setup-named-chroot.sh |   20 +++++++++++---------
 2 files changed, 15 insertions(+), 10 deletions(-)
---
diff --git a/bind.spec b/bind.spec
index 7677947..fd7661d 100644
--- a/bind.spec
+++ b/bind.spec
@@ -22,7 +22,7 @@ Summary:  The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) serv
 Name:     bind
 License:  ISC
 Version:  9.9.0
-Release:  4%{?dist}
+Release:  5%{?dist}
 Epoch:    32
 Url:      http://www.isc.org/products/BIND/
 Buildroot:%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -774,6 +774,9 @@ rm -rf ${RPM_BUILD_ROOT}
 %endif
 
 %changelog
+* Thu Apr 26 2012 Adam Tkac <atkac redhat com> 32:9.9.0-5
+- initscript: don't umount /var/named when didn't mount it
+
 * Tue Apr 24 2012 Adam Tkac <atkac redhat com> 32:9.9.0-4
 - apply all non-SDB patches before SDB ones (#804475)
 - enable Berkeley DB DLZ backend (#804478)
diff --git a/setup-named-chroot.sh b/setup-named-chroot.sh
index 38cb1ce..20dfd35 100755
--- a/setup-named-chroot.sh
+++ b/setup-named-chroot.sh
@@ -53,15 +53,17 @@ mount_chroot_conf()
 
 umount_chroot_conf()
 {
-  for all in $ROOTDIR_MOUNT; do
-    # Check if file is mount target. Do not use /proc/mounts because detecting
-    # of modified mounted files can fail.
-    if mount | grep -q '.* on '"$ROOTDIR$all"' .*'; then
-      umount "$ROOTDIR$all"
-      # Remove temporary created files
-      [ -f "$all" ] && rm -f "$ROOTDIR$all"
-    fi
-  done
+  if [ -n "$ROOTDIR" ]; then
+    for all in $ROOTDIR_MOUNT; do
+      # Check if file is mount target. Do not use /proc/mounts because detecting
+      # of modified mounted files can fail.
+      if mount | grep -q '.* on '"$ROOTDIR$all"' .*'; then
+        umount "$ROOTDIR$all"
+        # Remove temporary created files
+        [ -f "$all" ] && rm -f "$ROOTDIR$all"
+      fi
+    done
+  fi
 }
 
 case "$2" in


More information about the scm-commits mailing list