Skip to content

AGCS-11915 : Fix volume permission issue #2810

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions OracleIdentityGovernance/samples/scripts/agentManagement.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,7 @@ createDir(){

if [ -d "$absoluteVolumePath"/data ]
then
if [ "$(podman --version 2>/dev/null)" ]
then
chmod -R 777 "$absoluteVolumePath"/data >/dev/null 2>&1
else
chmod -R 775 "$absoluteVolumePath"/data >/dev/null 2>&1
fi
fi


Expand Down Expand Up @@ -314,9 +309,9 @@ runAgent(){
then
echo "INFO: Starting new container."
if [ -f "$CONFDIR"/config.properties ]; then
podman run -d --env-file "$CONFDIR"/config.properties -v "$PV":/app --group-add "$groupId" --name "$AI" "$imageName"
podman run -d --user root --env-file "$CONFDIR"/config.properties -v "$PV":/app --group-add "$groupId" --name "$AI" "$imageName"
else
podman run -d -v "$PV":/app --group-add "$groupId" --name "$AI" "$imageName"
podman run -d --user root -v "$PV":/app --group-add "$groupId" --name "$AI" "$imageName"
fi

podman exec "$AI" /bin/bash -c 'agent ido validate --config /app/data/conf/config.json; if [[ "$?" != "0" ]] ; then echo VALIDATE_FAILED > /app/data/conf/status.txt; else echo VALIDATE_SUCCESS > /app/data/conf/status.txt; fi ;'
Expand Down Expand Up @@ -820,12 +815,7 @@ upgrade()

#createDir changes the current working directory
mkdir -p "${PV}/upgrade"
if [ "$(podman --version 2>/dev/null)" ]
then
chmod -R 777 "${PV}/upgrade" >/dev/null 2>&1
else
chmod -R 775 "${PV}/upgrade" >/dev/null 2>&1
fi
chmod -R 775 "${PV}/upgrade" >/dev/null 2>&1

createDir "${PV}/upgrade"
# shellcheck disable=SC2129
Expand Down