summaryrefslogtreecommitdiff
path: root/sh
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-03-04 22:03:41 +0000
committerRoy Marples <roy@marples.name>2008-03-04 22:03:41 +0000
commitff162b39ace915ed9803ff7d091157855cf6d48c (patch)
treef93bda09026eebfe6fbf30ca62034132b2aa14c0 /sh
parent0e147427837fbb7e3d15f19507f64bed3ea5d83c (diff)
downloadopenrc-ff162b39ace915ed9803ff7d091157855cf6d48c.tar.gz
openrc-ff162b39ace915ed9803ff7d091157855cf6d48c.tar.bz2
openrc-ff162b39ace915ed9803ff7d091157855cf6d48c.tar.xz
Don't rely on fuser being present
Diffstat (limited to 'sh')
-rw-r--r--sh/rc-mount.sh12
1 files changed, 7 insertions, 5 deletions
diff --git a/sh/rc-mount.sh b/sh/rc-mount.sh
index 81d677a..c7a6ecf 100644
--- a/sh/rc-mount.sh
+++ b/sh/rc-mount.sh
@@ -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;;