init.d/*: check if RC_CACHEDIR is writtable

Bug: https://github.com/OpenRC/openrc/issues/890
Fixes: https://github.com/OpenRC/openrc/issues/936
This commit is contained in:
Anna (navi) Figueiredo Gomes 2025-11-05 00:37:34 +01:00 committed by navi
parent ef1cd9255a
commit f09ca47fe5
4 changed files with 4 additions and 4 deletions

View File

@ -61,7 +61,7 @@ start()
eend $retval
# Store the font so we can use it ASAP on boot
if [ $retval -eq 0 ] && checkpath -m 0755 -d "$RC_CACHEDIR" 2>/dev/null; then
if [ $retval -eq 0 ] && checkpath -W -m 0755 -d "$RC_CACHEDIR" 2>/dev/null; then
mkdir -p "$RC_CACHEDIR"/console
setfont -O "$RC_CACHEDIR"/console/font
fi

View File

@ -23,7 +23,7 @@ start()
{
ebegin "Saving terminal encoding"
# Save the encoding for use immediately at boot
if checkpath -m 0755 -d "$RC_CACHEDIR" 2>/dev/null; then
if checkpath -W -m 0755 -d "$RC_CACHEDIR" 2>/dev/null; then
mkdir -p "$RC_CACHEDIR"/console
if yesno ${unicode:-yes}; then
echo "" > "$RC_CACHEDIR"/console/unicode

View File

@ -21,7 +21,7 @@ start()
fi
fi
if ! checkpath -m 0755 -d "$RC_CACHEDIR" 2>/dev/null; then
if ! checkpath -W -m 0755 -d "$RC_CACHEDIR" 2>/dev/null; then
eerror "Unable to save dependency cache"
if yesno "${RC_GOINGDOWN}"; then
return 0

View File

@ -41,7 +41,7 @@ start()
done
# Save the encoding for use immediately at boot
if checkpath -m 0755 -d "$RC_CACHEDIR"; then
if checkpath -W -m 0755 -d "$RC_CACHEDIR"; then
mkdir -p "$RC_CACHEDIR"/console
if yesno ${unicode:-yes}; then
echo "" > "$RC_CACHEDIR"/console/unicode