Skip to content

Commit

Permalink
Merge branch 'hyperledger:main' into issue-3810-no-empty-block
Browse files Browse the repository at this point in the history
  • Loading branch information
amsmota committed Sep 23, 2024
2 parents 66ad32e + 0d63955 commit 9b9f499
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions besu/src/main/scripts/besu-entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
## SPDX-License-Identifier: Apache-2.0
##

# Construct the command as a single string
COMMAND="/opt/besu/bin/besu $@"

# Check if current user is not root. If not, run the command as is.
if [ "$(id -u)" -ne 0 ]; then
exec /bin/bash -c "$COMMAND"
fi

# Run Besu first to get paths needing permission adjustment
output=$(/opt/besu/bin/besu --print-paths-and-exit $BESU_USER_NAME "$@")

Expand Down Expand Up @@ -41,9 +49,5 @@ echo "$output" | while IFS=: read -r prefix path accessType; do
fi
done

# Finally, run Besu with the actual arguments passed to the container
# Construct the command as a single string
COMMAND="/opt/besu/bin/besu $@"

# Switch to the besu user and execute the command
exec su -s /bin/bash $BESU_USER_NAME -c "$COMMAND"
exec su -s /bin/bash "$BESU_USER_NAME" -c "$COMMAND"

0 comments on commit 9b9f499

Please sign in to comment.