Skip to content

Commit b9235fb

Browse files
authored
fix: setfacl operation not supported
1 parent 15dbd50 commit b9235fb

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

frankenphp/docker-entrypoint.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,17 @@ if [ "$1" = 'frankenphp' ] || [ "$1" = 'php' ] || [ "$1" = 'bin/console' ]; then
5757
fi
5858
fi
5959

60-
setfacl -R -m u:www-data:rwX -m u:"$(whoami)":rwX var
61-
setfacl -dR -m u:www-data:rwX -m u:"$(whoami)":rwX var
60+
SETFACL_STATUS=0
61+
SETFACL_ERROR=$(setfacl -m u:www-data:rwX -m u:"$(whoami)":rwX var 2>&1 1>/dev/null) || SETFACL_STATUS=$?
62+
if [ $SETFACL_STATUS -eq 0 ]; then
63+
setfacl -R -m u:www-data:rwX -m u:"$(whoami)":rwX var
64+
setfacl -dR -m u:www-data:rwX -m u:"$(whoami)":rwX var
65+
elif echo "$SETFACL_ERROR" | grep -q "Operation not supported"; then
66+
# https://github.com/maelgangloff/domain-watchdog/issues/74
67+
chown -R "$(whoami)":www-data var
68+
else
69+
echo "$SETFACL_ERROR" >&2
70+
fi
6271

6372
echo 'PHP app ready!'
6473
fi

0 commit comments

Comments
 (0)