Windows service user

I have setup multiple agents all running as a Windows service running as a specific user.  
Two of the machines always report the environment variable Username as "SYSTEM".  It seems to find the correct username in other areas such as USERPROFILE.
I tried removing the agent, reinstalling, and reactivating the agent with the same outcome.  Any advice on how to figure this one out?

Running: 5.1 EAP (build 13130)

3 comments

Hello,

  You can specify the user TeamCity agent runs under in the TeamCity agent windows service preferences (see red section at our docs).

  Hope this helps,
  KIR

0

Yes, I have it running under a domain acount ( I.E. domain\userXYZ ).  When I look at the services control panel it is running as that user.
When I look under the environment variables tab for the agent in TeamCity, I see that everything looks correct except for USERNAME which still says "SYSTEM" ( i.e. APPDATA is pointing to the correct location, C:\Users\userXYZ\AppData\Roaming - TEMP, USERPROFILE,  LOCALAPPDATA all look correct).

Out of the 5 Windows agents that I have, two are showing up as running under SYSTEM, while the other 3 are successfully running under the correct domain account.  All the Windows machines were setup to run the agent under the same domain user account.  The only thing I can think that happened was that the systems having the issues, might have started up the first time running under system, before I realized that I forgot to setup the service to run as the specific user.

0

Hello,

  I'd suggest to try running a simple command script, which just prints all the environment variables (via cmd.exe and script with SET command?).
  This way you'll get exact information about environment of the build process.

  Regards,
  KIR

0

Please sign in to leave a comment.