Skip to content

Commit

Permalink
Update data directory owner to opensearch (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
pritamdas99 authored Nov 24, 2023
1 parent f5e3197 commit 314370f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
12 changes: 4 additions & 8 deletions scripts/config-merger.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ NODE_ROLES=${NODE_ROLES:-""}
# Make a list of roles
IFS=',' read -ra ROLES <<<"$NODE_ROLES"

echo "changing the ownership of data folder: /usr/share/opensearch/data"
chown -R "$ELASTICSEARCH_UID":"$ELASTICSEARCH_UID" /usr/share/opensearch/data
if [[ "$(id -u)" == "0" ]]; then
echo "changing the ownership of data folder: /usr/share/opensearch/data"
chown -R "$ELASTICSEARCH_UID":"$ELASTICSEARCH_UID" /usr/share/opensearch/data
fi

# load default config files to config directory
cp -f -R $DEFAULT_CONFIG_DIR/* $CONFIG_DIR
Expand Down Expand Up @@ -103,9 +105,6 @@ for FILE_DIR in "$CONFIG_DIR"/*; do
fi
done
fi

# restore original file permission
chmod "$ORIGINAL_PERMISSION" "$FILE_DIR"
done

##-------------------------------OpenSearch----------------------------------
Expand Down Expand Up @@ -191,8 +190,5 @@ if [ -d $SECURITY_CONFIG_DIR ]; then
fi
done
fi

# restore original file permission
chmod "$ORIGINAL_PERMISSION" "$FILE_DIR"
done
fi
2 changes: 0 additions & 2 deletions scripts/dashboard-config-merger.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,4 @@ for FILE_DIR in "$CONFIG_DIR"/*; do

fi

# restore original file permission
chmod "$ORIGINAL_PERMISSION" "$FILE_DIR"
done

0 comments on commit 314370f

Please sign in to comment.