From: Russ Allbery Date: Tue, 4 May 2010 22:25:09 +0000 (-0700) Subject: Parse /etc/mtab instead of the mount command to find the AFS mount X-Git-Tag: debian/1.5.74.1-1~6 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=406ca207aa142b4c6827e668650e2096deb50335;p=packages%2Fo%2Fopenafs.git 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. --- diff --git a/debian/changelog b/debian/changelog index bd3011b5c..200847306 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Tue, 04 May 2010 16:13:13 -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