Skip to content

Commit 7f88251

Browse files
committed
[bitnami/elasticsearch] do not fail if asked to chown read-only files
Added -f to chmod commands so they do not fail if any of the target folders or their subdirectories are mounted from a read-only filesystem Signed-off-by: Ian Roberts <[email protected]>
1 parent 1e1e736 commit 7f88251

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bitnami/elasticsearch/8/debian-12/rootfs/opt/bitnami/scripts/libelasticsearch.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ elasticsearch_validate() {
379379
am_i_root && ensure_user_exists "$DB_DAEMON_USER" --group "$DB_DAEMON_GROUP"
380380
for dir in "$DB_TMP_DIR" "$DB_LOGS_DIR" "$DB_PLUGINS_DIR" "$DB_BASE_DIR/modules" "$DB_CONF_DIR"; do
381381
ensure_dir_exists "$dir"
382-
am_i_root && chown -R "$DB_DAEMON_USER:$DB_DAEMON_GROUP" "$dir"
382+
am_i_root && chown -R -f "$DB_DAEMON_USER:$DB_DAEMON_GROUP" "$dir"
383383
done
384384

385385
debug "Validating settings in DB_* env vars..."
@@ -686,7 +686,7 @@ elasticsearch_initialize() {
686686
debug "Ensuring expected directories/files exist..."
687687
for dir in "$DB_TMP_DIR" "$DB_LOGS_DIR" "$DB_PLUGINS_DIR" "$DB_BASE_DIR/modules" "$DB_CONF_DIR"; do
688688
ensure_dir_exists "$dir"
689-
am_i_root && chown -R "$DB_DAEMON_USER:$DB_DAEMON_GROUP" "$dir"
689+
am_i_root && chown -R -f "$DB_DAEMON_USER:$DB_DAEMON_GROUP" "$dir"
690690
done
691691
for dir in "${data_dirs_list[@]}"; do
692692
ensure_dir_exists "$dir"

0 commit comments

Comments
 (0)