Details
-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
None
-
None
Description
Scott Koranda
Fri 1/15/2021 4:04 PM
To: *
Hyzer, Chris
Hi,
The problem with 2.5.39 is that in the file /usr/local/bin/gsh
you have
if [ "$GROUPER_GSH_CHECK_USER" = "true" ] && [ "$GROUPER_GSH_USER" != "$username" ]
then
sudo -u tomcat bin/gsh.sh "$@" | tee /tmp/loggrouper
else
exec bin/gsh.sh "$@" | tee /tmp/loggrouper
fi
When the container is running as root, the sudo command is executed.
But sudo does not by default pass through environment variables from the
shell in which it is invoked. It creates a brand new shell. So the
environment variable
GROUPER_DATABASE_URL
is never making it to the Java layer when ./bin/gsh runs.
One way to fix this (it may not be the best way), is to add the
--preserve-env
flag to sudo.
I tried that and it worked.
Thanks,
Scott