Skip to content

Commit

Permalink
Merge pull request ClickHouse#39898 from pkit/pkit/fix_mkdir_nfs
Browse files Browse the repository at this point in the history
fix broken NFS mkdir introduced in ClickHouse#36341
  • Loading branch information
alexey-milovidov authored Aug 5, 2022
2 parents c6e3e14 + 67a6b32 commit 20fdc5b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion docker/server/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,15 @@ do
# check if variable not empty
[ -z "$dir" ] && continue
# ensure directories exist
if ! mkdir -p "$dir"; then
if [ "$DO_CHOWN" = "1" ]; then
mkdir="mkdir"
else
# if DO_CHOWN=0 it means that the system does not map root user to "admin" permissions
# it mainly happens on NFS mounts where root==nobody for security reasons
# thus mkdir MUST run with user id/gid and not from nobody that has zero permissions
mkdir="/usr/bin/clickhouse su "${USER}:${GROUP}" mkdir"
fi
if ! $mkdir -p "$dir"; then
echo "Couldn't create necessary directory: $dir"
exit 1
fi
Expand Down

0 comments on commit 20fdc5b

Please sign in to comment.