]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Parse /etc/mtab instead of the mount command to find the AFS mount
authorRuss Allbery <rra@debian.org>
Tue, 4 May 2010 22:25:09 +0000 (15:25 -0700)
committerRuss Allbery <rra@debian.org>
Tue, 4 May 2010 23:21:23 +0000 (16:21 -0700)
The /etc/mtab syntax doesn't contain an English word and is therefore
less likely to change based on localization.  Hopefully this will be
equivalent.

debian/changelog
debian/openafs-client.init

index bd3011b5cda37c0fab03681d8fafafb7dd8b6319..2008473066f683b4e9d09132bd63b58f99b60264 100644 (file)
@@ -11,7 +11,7 @@ openafs (1.5.74.1-1) UNRELEASED; urgency=low
     (Closes: #580077)
   * In the openafs-client init script, don't assume that AFS is mounted on
     /afs when unmounting it or killing processes with AFS files open.
-    Instead, parse the output from mount to find the AFS mount point.
+    Instead, parse /etc/mtab to find the AFS mount point.
 
  -- Russ Allbery <rra@debian.org>  Tue, 04 May 2010 16:13:13 -0700
 
index e04a600f8827e2e4eb161215f7682a94def0a830..6ad150da9d1e0a6563cfdb6d8abdacb70fbfe884 100755 (executable)
@@ -177,7 +177,7 @@ start_client() {
 # normally called via kill_all_afs.
 kill_afs() {
     signal=$1
-    mount=`mount | grep ^AFS | awk '{ print $3}'`
+    mount=`grep ^'AFS ' /etc/mtab | awk '{ print $2 }'`
     pids=`/usr/bin/lsof -Fp $mount | sed 's/p//'`
     if [ -n "$pids" ] ; then
         kill -$signal $pids > /dev/null 2>&1
@@ -239,8 +239,8 @@ force-start)
 stop|force-stop)
     $AFS_PRE_SHUTDOWN
     echo -n "Stopping AFS services:"
-    if mount | grep -q '^AFS' ; then
-        umount `mount | grep ^AFS | awk '{ print $3}'`
+    if grep -q '^AFS ' /etc/mtab ; then
+        umount `grep ^'AFS ' /etc/mtab | awk '{ print $2 }'`
         echo -n " afsd"
     fi
     if pidof /usr/sbin/afsd >/dev/null || pidof /sbin/afsd >/dev/null ; then