From e150232edb5272658e2c0b731a441da11ef9d995 Mon Sep 17 00:00:00 2001 From: Georgi Georgiev Date: Thu, 21 Jul 2022 09:24:54 +0900 Subject: [PATCH] (PA-4787) Warnings when running embedded ruby Getting warnings when running the wrapped binaries when bundler has exported some environment variables. The fix is to clean out the environment before running the ruby process which strips the `LD_LIBRARY_PATH`. --- resources/files/sysv-wrapper.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/resources/files/sysv-wrapper.sh b/resources/files/sysv-wrapper.sh index 066e1e93e9..6f0dda05cd 100644 --- a/resources/files/sysv-wrapper.sh +++ b/resources/files/sysv-wrapper.sh @@ -1,5 +1,14 @@ #!/bin/sh +unset GEM_HOME +unset GEM_PATH +unset DLN_LIBRARY_PATH +unset RUBYLIB +unset RUBYLIB_PREFIX +unset RUBYOPT +unset RUBYPATH +unset RUBYSHELL + # We keep around any paths in LD_LIBRARY_PATH that start with /opt/rh/. Those paths are # from redhat software collections packages and are required for things like SCL python # to work. See PUP-8351. @@ -10,14 +19,6 @@ end" LD_LIBRARY_PATH=`/opt/puppetlabs/puppet/bin/ruby -e "$STRIP_LDLYP_COMMAND"` export LD_LIBRARY_PATH unset LD_PRELOAD -unset GEM_HOME -unset GEM_PATH -unset DLN_LIBRARY_PATH -unset RUBYLIB -unset RUBYLIB_PREFIX -unset RUBYOPT -unset RUBYPATH -unset RUBYSHELL # If $PATH does not match a regex for /opt/puppetlabs/bin if [ `expr "${PATH}" : '.*/opt/puppetlabs/bin'` -eq 0 ]; then