aboutsummaryrefslogtreecommitdiff
path: root/init.d
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 /init.d
parent5983add0f21fdacded88836aae8b8e392599060c (diff)
Really test if we can write to RC_LIBDIR or not.
Diffstat (limited to 'init.d')
-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 74ac02b7..47f86618 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