From c2781c209ec01a863b11f50a0df2d09c6702cbc9 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Wed, 9 Jul 2008 15:12:56 +0000 Subject: Really test if we can write to RC_LIBDIR or not. --- init.d/halt.sh.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3