summaryrefslogtreecommitdiff
path: root/init.d/savecache.in
diff options
context:
space:
mode:
authorWilliam Hubbs <williamh@gentoo.org>2011-03-06 11:50:06 -0600
committerWilliam Hubbs <williamh@gentoo.org>2011-03-06 11:50:06 -0600
commit87302487d20bda52735031bf8f53fa57c2e33a03 (patch)
tree65c34a1e6c3d1d5d78508e2b8fd3dda0fe6559e4 /init.d/savecache.in
parent0f3d6a01c7136edf1a7cecb764473ddc7f2cfe61 (diff)
downloadopenrc-87302487d20bda52735031bf8f53fa57c2e33a03.tar.gz
openrc-87302487d20bda52735031bf8f53fa57c2e33a03.tar.bz2
openrc-87302487d20bda52735031bf8f53fa57c2e33a03.tar.xz
savecache should not fail if we are shutting down
Since mount-ro needs to run unconditionally, we need to have savecache report that it ran successfully when the system is shutting down. X-Gentoo-Bug: 356393 X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=356393
Diffstat (limited to 'init.d/savecache.in')
-rw-r--r--init.d/savecache.in17
1 files changed, 13 insertions, 4 deletions
diff --git a/init.d/savecache.in b/init.d/savecache.in
index 2c981c6..d2d51b8 100644
--- a/init.d/savecache.in
+++ b/init.d/savecache.in
@@ -8,17 +8,22 @@ start()
{
if [ -e "$RC_SVCDIR"/clock-skewed ]; then
ewarn "WARNING: clock skew detected!"
- if ! yesno "savecache_skewed"; then
+ if ! yesno "${RC_GOINGDOWN}"; then
eerror "Not saving deptree cache"
return 1
fi
fi
ebegin "Saving dependency cache"
+ local rc=
if [ ! -d "$RC_LIBEXECDIR"/cache ]; then
rm -rf "$RC_LIBEXECDIR"/cache
if ! mkdir "$RC_LIBEXECDIR"/cache; then
- eend $?
- return $?
+ rc=$?
+ if yesno "${RC_GOINGDOWN}"; then
+ rc=0
+ fi
+ eend $rc
+ return $rc
fi
fi
local save=
@@ -28,5 +33,9 @@ start()
if [ -n "$save" ]; then
cp -p $save "$RC_LIBEXECDIR"/cache 2>/dev/null
fi
- eend $?
+ rc=$?
+ if yesno "${RC_GOINGDOWN}"; then
+ rc=0
+ fi
+ eend $rc
}