Hi,
We have a bamboo agent installed on a Windows server and is running as a service. On the service it's setup to log on using one of our domain service accounts i.e. svc_bamboo_agent. The problem I have is that when I run a simple bamboo Script task on the agent 'echo %username%' it's displaying as 'SYSTEM' instead of the expected 'svc_bamboo_agent'. Why is this? How do I change it so the script is run under the service account 'svc_bamboo_agent?
Cheers
Hi John,
It seems like this is a known issue on Windows.
The good news is that the process should still be running as svc_bamboo_agent - just try running whoami in your script task - you should find that that returns svc_bamboo_agent, and it's really just the %USERNAME% variable that's incorrectly set by Windows.
If you depend on that variable, you can set it to the actual username as part of your script task.
Cheers,
Christian
Premier Support Engineer
Atlassian
Awesome thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't think this is an issue with Windows, it's more of a problem with the Tanuki wrapper that runs the agent, which does some black magic to load the environment, messing things up in the process, e.g., this other issue with the PATH variable.
I've wasted so much time because of this - it's not even funny. I even messed with the agent's JAR file trying to get it to run as my custom user, because I kept thinking the problem was the service running as SYSTEM... at least this post saved me from going mad.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.