Skip to content

Commit

Permalink
fix: chown fail when OS create folders or files with root only permis…
Browse files Browse the repository at this point in the history
…sion

Signed-off-by: Tiến Nguyễn Khắc <tien.nguyenkhac@icloud.com>
(cherry picked from commit cff9793)
  • Loading branch information
tien committed May 13, 2024
1 parent 003bdf9 commit 11e6bfc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions janusgraph-dist/docker/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ JANUSGRAPH_SERVER_YAML="${JANUS_CONFIG_DIR}/janusgraph-server.yaml"
# running as root; step down to run as janusgraph user
if [ "$1" == 'janusgraph' ] && [ "$(id -u)" == "0" ]; then
mkdir -p ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR}
chown -R janusgraph:janusgraph ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR}
chown janusgraph:janusgraph ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR}
chmod 700 ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR}

exec chroot --skip-chdir --userspec janusgraph:janusgraph / "${BASH_SOURCE}" "$@"
Expand All @@ -32,7 +32,7 @@ if [ "$1" == 'janusgraph' ]; then
mkdir -p ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR}
cp conf/janusgraph-${JANUS_PROPS_TEMPLATE}-server.properties ${JANUS_PROPS}
cp conf/janusgraph-server.yaml ${JANUSGRAPH_SERVER_YAML}
chown -R "$(id -u):$(id -g)" ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR}
chown "$(id -u):$(id -g)" ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR}
chmod 700 ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR}
chmod -R 600 ${JANUS_CONFIG_DIR}/*

Expand Down

0 comments on commit 11e6bfc

Please sign in to comment.