buildAgent launchd config loads as inactive in TeamCity

I have configured TeamCity to start with a launchd plist in /Library/LaunchAgents and it works great but unlike runAll.sh the default buildAgent isn't available. I don't need a custom buildAgent, just want the default buildAgent to start with TeamCity as a launch agent or launch daemon.

So I configured ./TeamCity/buildAgent to start with launchd plist (below) in /Library/LaunchDaemons (tried LaunchAgents and that failed with permission errors and I found articles on the web saying to do it in LaunchDaemons even though TeamCity is a LaunchAgent).

Anyway both processes are running on the same Mac with the same user.

After a system restart, launchd err and std out logs are empty, and there are no error log entries for the agent itself and using launchctl, you can see it's loaded:

> launchctl load /Library/LaunchDaemons/jetbrains.teamcity.BuildAgent.plist
/Library/LaunchDaemons/jetbrains.teamcity.BuildAgent.plist: service already loaded

But when I browse to TeamCity (localhost:8111) the Agents available indicator shows "0".

Agents view shows 0 connected and 2 disconnected agents:

Default Agent - Status: green - Last communication: 06 Nov 17 10:03 - Inactivity reason: Server shutdown
local - Status: green - Last communication: 05 Nov 17 13:44 - Agent has unregistered (will upgrade)

Anyone have any ideas what I need to look at? I've attached my launchd plist as well, in case there is something wrong in there. I just want to use the default buildAgent exactly as if I had started TeamCity with runAll.sh.

Here is my launchd plist:

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<plist version="1.0">

<dict>

        <key>WorkingDirectory</key>

        <string>/Users/teamcity/TeamCity/buildAgent</string>

        <key>Debug</key>

        <false/>

        <key>Label</key>

        <string>jetbrains.teamcity.BuildAgent</string>

        <key>OnDemand</key>

        <false/>

        <key>KeepAlive</key>

        <true/>

        <key>ProgramArguments</key>

        <array>

                <string>launcher/bin/TeamCityAgentService-macosx-universal-32</string>

                <string>-c</string>

                <string>../conf/wrapper.conf</string>

        </array>

        <key>RunAtLoad</key>

        <true/>

        <key>StandardErrorPath</key>

        <string>logs/launchd.err.log</string>

        <key>StandardOutPath</key>

        <string>logs/launchd.std.log</string>

        <key>EnvironmentVariables</key>

        <dict>

                <key>LC_TYPE</key>

                <string>en_US.UTF-8</string>

        </dict>

        <key>UserName</key>

        <string>teamcity</string>

</dict>

</plist>

 

0
1 comment

An "Agent disconnected (will upgrade)" message doesn't mean that the service isn't starting. This usually happens when the agent does start up, connects to the server, and starts to download the plugins, updates, etc. It can take a few minutes and even several restarts depending on the agent's situation. If you would like to see its progress, or if it seems to be in an endless loop, please check the agent's upgrade.log and teamcity-agent.log files. They might indicate issues with specific files, and the agent is in a loop waiting for the problem to be fixed.

0

Please sign in to leave a comment.