Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-11999

Bamboo remote agent wrapper shell script force resets $PATH using su -m

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • None
    • Agents
    • Standalone 64-bit Ubuntu
    • 0
    • 1
    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

    Description

      Line 329 of bamboo-agent.sh reads:

      su -m $RUN_AS_USER -c "\"$REALPATH\" $2"
      

      $PATH is then hardcoded down the script to include only $JAVA_HOME/bin and what's in /etc/login.defs.

      This has the effect of generally munging otherwise valid environment configurations for specific paths to specific tools the build agent may need;

      I've ended up changing the above line to:

      su - $RUN_AS_USER -c "\"$REALPATH\" $2"
      

      so as to be able to handle PATH outside what the startup scripts are attempting to do, but it would be nice to either a) document that more effectively or b) provide an override mechanism so I don't have to sed my way through the startup scripts every time we deploy a new agent.

      Attachments

        Activity

          People

            Unassigned Unassigned
            4c7f42da203a John Knight
            Votes:
            4 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated: