summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-07-09 15:12:56 +0000
committerRoy Marples <roy@marples.name>2008-07-09 15:12:56 +0000
commitc2781c209ec01a863b11f50a0df2d09c6702cbc9 (patch)
tree53605abfa2745f6ab9264067f7a3b0f86f629fe0
parent5983add0f21fdacded88836aae8b8e392599060c (diff)
downloadopenrc-c2781c209ec01a863b11f50a0df2d09c6702cbc9.tar.gz
openrc-c2781c209ec01a863b11f50a0df2d09c6702cbc9.tar.bz2
openrc-c2781c209ec01a863b11f50a0df2d09c6702cbc9.tar.xz
Really test if we can write to RC_LIBDIR or not.
-rw-r--r--init.d/halt.sh.in6
1 files changed, 5 insertions, 1 deletions
diff --git a/init.d/halt.sh.in b/init.d/halt.sh.in
index 74ac02b..47f8661 100644
--- a/init.d/halt.sh.in
+++ b/init.d/halt.sh.in
@@ -38,7 +38,11 @@ fi
# If $svcdir is still mounted, preserve it if we can
mnt=$(mountinfo --node "${RC_SVCDIR}")
-if [ -n "${mnt}" -a -w "${RC_LIBDIR}" ]; then
+if [ -n "${mnt}" ] && \
+ rm -rf "${RC_LIBDIR}/tmp.$$" && \
+ mkdir -p "${RC_LIBDIR}/tmp.$$" \
+; then
+ rmdir "${RC_LIBDIR}/tmp.$$"
f_opts="-m -c"
[ "${RC_UNAME}" = "Linux" ] && f_opts="-c"
if type fuser >/dev/null 2>&1; then