Don't rely on fuser being present
This commit is contained in:
parent
0e14742783
commit
ff162b39ac
@ -7,9 +7,7 @@
|
||||
# This isn't a real issue for the BSD's, but it is for Linux.
|
||||
do_unmount()
|
||||
{
|
||||
type fuser >/dev/null 2>&1 || return 0
|
||||
|
||||
local cmd="$1" retval=0 retry=
|
||||
local cmd="$1" retval=0 retry= pids=-
|
||||
local f_opts="-m -c" f_kill="-s " mnt=
|
||||
if [ "${RC_UNAME}" = "Linux" ]; then
|
||||
f_opts="-m"
|
||||
@ -33,13 +31,17 @@ do_unmount()
|
||||
|
||||
retry=3
|
||||
while ! LC_ALL=C ${cmd} "${mnt}" 2>/dev/null; do
|
||||
# Don't kill if it's us (/ and possibly /usr)
|
||||
local pids="$(fuser ${f_opts} "${mnt}" 2>/dev/null)"
|
||||
if type fuser >/dev/null 2>&1; then
|
||||
pids="$(fuser ${f_opts} "${mnt}" 2>/dev/null)"
|
||||
fi
|
||||
case " ${pids} " in
|
||||
*" $$ "*)
|
||||
eend 1 "failed because we are using" \
|
||||
"${mnt}"
|
||||
retry=0;;
|
||||
" - ")
|
||||
eend 1
|
||||
retry=0;;
|
||||
" ")
|
||||
eend 1 "in use but fuser finds nothing"
|
||||
retry=0;;
|
||||
|
Loading…
x
Reference in New Issue
Block a user