Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How can I change the users home directory in bamboo ?

Hector Magnanao April 11, 2018

When I look at the properties of my remote agent,  the users home directory is being set to C:\Users\TEMP.  Is there a way to set it to the C:\Users\<user running bamboo> ?

I'm referring to the users home directory.  Not the bamboo build directory.

1 answer

0 votes
rsperafico
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 11, 2018

Hi @Hector Magnanao,

If you already have a remote agent running, you could:

  1. stop Bamboo remote agent
  2. edit <bamboo-remote-home>/conf/wrapper.conf and update property to point to the chosen location in filesystem:
    wrapper.java.additional.1=-Dbamboo.home=C:\Users\TEMP
  3. copy <bamboo-remote-home> to the location specified above
  4. start Bamboo remote agent

If you are installing a new remote agent, you can provide <bamboo-remote-home> directory in java command:

java -Dbamboo.home=/path/to/bamboo-remote-home -jar atlassian-bamboo-agent-installer-X.X-SNAPSHOT.jar http://bamboo-host-server:8085/agentServer/

Please, refer to the following documentation for further information:

Note: User running Bamboo remote agent must have full access to the directory specified.

Kind regards,

Rafael

Hector Magnanao April 11, 2018

Hi Rafael,

the bamboo home directory is set correctly.  It's the bamboo users home directory that is being set to C:\Users\TEMP.  It should be set to C:\Users\<bamboo account>

This is causing the builds to fail because it can't find the settings.xml file in the correct folder.  I can't use the current directory because it might be removed one day.

Hector Magnanao April 11, 2018

The system properties of the bamboo agent is attached.  The problem is circled in red.

 

bamboo_sysproperties.PNG

rsperafico
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 11, 2018

Hi @Hector Magnanao,

That is the temp directory and you can updated it by:

  1. stop Bamboo remote agent
  2. edit <bamboo-remote-home>/conf/wrapper.conf and update property to point to the chosen location in filesystem:
    wrapper.java.additional.X=-Djava.io.tmpdir=C:\Users\TEMP
    where .X is the following number in sequence
  3. copy <bamboo-remote-home> to the location specified above
  4. start Bamboo remote agent

Kind regards,

Rafael

Hector Magnanao April 11, 2018

Hi Rafael,

When I tried to set that variable to C:\Users\3_bamboo in the wrapper.conf file, the User Home is being set to C:\

I would like to set User Home in that window to C:\Users\3_bamboo

I believe that if I can set the User Home to this value, then the temporary directory will also be set correctly.

How do I set the User Home directory in that conf file ?

rsperafico
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 11, 2018

Hi @Hector Magnanao,

Could you share wrapper.conf displaying all wrapper.java.additional properties?

What is the output for Temporary directory?

What is the user running Bamboo remote agent? If running as a Windows Service, please run using Local user instead of System.

What is the output of command from CMD?

echo %homepath%

Kind regards,

Rafael

Hector Magnanao April 12, 2018

Hi @rsperafico

contents of wrapper.conf (default content):

# The Bamboo Agent home configuration file
wrapper.java.additional.1=-Dbamboo.home="D:\bamboo-agent-home"
wrapper.java.additional.2=-Dbamboo.agent.ignoreServerCertName=false
#wrapper.java.additional.3=-Dlog4j.configuration=
#wrapper.java.additional.3=-agentlib:yjpagent

output for temporary directory:

Temporary directoryC:\Users\TEMP\AppData\Local\Temp\

the user running Bamboo remote agent is 3_bamboo.  This is the service account that we need to run in bamboo. 

Unfortunately we are not allowed to login directly into the bamboo agent as a service account.  I can only login as myself. so echo %homepath%

C:\Users\i842625>echo %homepath%
\Users\i842625

rsperafico
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 12, 2018

Hi @Hector Magnanao,

In the same way Bamboo gets the temporary directory, e.g:

tempDir = sysProps.getProperty("java.io.tmpdir");

You could try and set up a new user home directory by providing "-Duser.home" as property that should be read by Bamboo from:

userHome = sysProps.getProperty("user.home");

So wrapper.conf should be:

# The Bamboo Agent home configuration file
wrapper.java.additional.1=-Dbamboo.home="D:\bamboo-agent-home"
wrapper.java.additional.2=-Dbamboo.agent.ignoreServerCertName=false
wrapper.java.additional.3=-Duser.home="C:\Users\<user running bamboo>"
#wrapper.java.additional.3=-Dlog4j.configuration=
#wrapper.java.additional.3=-agentlib:yjpagent

Kind regards,

Rafael

Hector Magnanao April 12, 2018

Rafael

 

Where do I set this variable in ?

userHome = sysProps.getProperty("user.home"); 
rsperafico
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 12, 2018

Hi @Hector Magnanao,

You don't, simply add the property -Duser.home to wrapper.conf as mentioned previously.

# The Bamboo Agent home configuration file
wrapper.java.additional.1=-Dbamboo.home="D:\bamboo-agent-home"
wrapper.java.additional.2=-Dbamboo.agent.ignoreServerCertName=false
wrapper.java.additional.3=-Duser.home="C:\Users\<user running bamboo>"
#wrapper.java.additional.3=-Dlog4j.configuration=
#wrapper.java.additional.3=-agentlib:yjpagent

Note: Bamboo remote agent must be restarted so changes can be applied.

Kind regards,

Rafael

Hector Magnanao April 12, 2018

Hi @rsperafico

Ok, so that worked.  I see that the user home directory is now set correctly.  

But,  it looks like C:\Users\temp is still being used by the build.  It appears that way because the repository is being created under C:\Users\Temp.  

Any ideas why this is happening ?

rsperafico
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 12, 2018

Hi @Hector Magnanao,

It appears that way because the repository is being created under C:\Users\Temp.

Are you referring to the repository caching? What is the content of C:\Users\temp?

Kind regards,

Rafael

Hector Magnanao April 12, 2018

Hi @rsperafico

Yes.  The content is .m2, settings files and the repository folders in it.

rsperafico
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 12, 2018

Hi @Hector Magnanao,

Please, raise a support case under https://support.atlassian.com so information related to directory and build logs can be shared.

Kind regards,

Rafael

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events