forked from facebookarchive/nfusr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathumount.fuse.nfusr
34 lines (28 loc) · 882 Bytes
/
umount.fuse.nfusr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
# If $1 is a mountpoint, return it; else if it is a mounted device,
# return the mountpoint for the device; else return eror.
#
# value returned in global $mountpoint.
get_mountpoint() {
if mountpoint -q -- $1; then
mountpoint=$1
return 0
fi
mountpoint=$(grep "^$1" /proc/mounts | cut -d' ' -f2)
if [ -n "$mountpoint" ]; then
return 0
fi
return 1
}
for arg in $@; do
if get_mountpoint $arg; then
# Please keep in sync with mount script, which starts these processes.
squashed_mountpoint=$(echo ${mountpoint} | sed 's^/^_^g')
statsbase="${TMPDIR:-/tmp}/nfusr_client${squashed_mountpoint}"
logfile="${statsbase}.log"
statsfile="${statsbase}.stats"
pkill -f "gfs_clientstats_scuba.*$logfile"
pkill -f "gfs_clientstats_ods.*$statsfile"
fi
done
umount -i $@