From 3d35fe11e3d400253b2b9d7e9f4a9c7f4c721360 Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Tue, 4 May 2010 15:25:09 -0700 Subject: [PATCH] Parse /etc/mtab instead of the mount command to find the AFS mount 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 | 2 +- debian/openafs-client.init | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index f213f0ded..0012fdb36 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,7 +11,7 @@ openafs (1.4.12+dfsg-4) 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 Tue, 04 May 2010 14:27:21 -0700 diff --git a/debian/openafs-client.init b/debian/openafs-client.init index e04a600f8..6ad150da9 100755 --- a/debian/openafs-client.init +++ b/debian/openafs-client.init @@ -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 -- 2.39.5