Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
GRP-5155: start GSH as GROUPER_GSH_USER in container
mchyzer committed Nov 25, 2023
1 parent 7e7c46d commit 7159150
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions container_files/usr-local-bin/containerPing
@@ -0,0 +1,11 @@
#!/bin/bash

prep_daemon
prep_finish
setupFiles
runCommand_unsetAll

export GSH_JVMARGS="$GSH_JVMARGS -DENV=$ENV -DUSERTOKEN=$USERTOKEN"

# sample command every 10 minutes, just a ping to keep container running, for testing
/usr/bin/ping -i 600 google.com
4 changes: 2 additions & 2 deletions container_files/usr-local-bin/gsh
@@ -11,9 +11,9 @@ export GSH_JVMARGS="$GSH_JVMARGS -DENV=$ENV -DUSERTOKEN=$USERTOKEN"
set -o pipefail

# openshift cannot do whoami
if [ "$GROUPER_GSH_CHECK_USER" = "true" ] && [ "$GROUPER_GSH_USER" != "$(whoami)" ]
if [ "$GROUPER_GSH_USER" != "$(whoami)" ] && [ $EUID -eq 0 ]
then
echo "grouperContainer; INFO: (gsh file) sudo --preserve-env -u tomcat bin/gsh.sh \"$@\" | tee /tmp/loggrouper"
echo "grouperContainer; INFO: (gsh file) sudo --preserve-env -u $GROUPER_GSH_USER bin/gsh.sh \"$@\" | tee /tmp/loggrouper"
sudo --preserve-env -u tomcat bin/gsh.sh "$@" | tee /tmp/loggrouper
else
echo "grouperContainer; INFO: (gsh file) bin/gsh.sh \"$@\" | tee /tmp/loggrouper"

0 comments on commit 7159150

Please sign in to comment.