Icon

You are viewing the documentation of TeamCity 2018.x, which is not the most recently released version of TeamCity.
View this page in the latest documentation or refer to the listing to choose the documentation corresponding to your TeamCity version.

 

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Fix autostart to provide PATH and other vars to the teamcity process

...

  1. Install TeamCity and make sure it works if started from the command line with bin/teamcity-server.sh start. We'll assume that TeamCity is installed in the /Library/TeamCity folder
  2. Create the /Library/LaunchDaemons/jetbrains.teamcity.server.plist file with the following content:

    Code Block
    <?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>/Library/TeamCity</string>
    	<key>Debug</key>
    	<false/>
    	<key>Label</key>
    	<string>jetbrains.teamcity.server</string>
    	<key>OnDemand</key>
    	<false/>
    	<key>KeepAlive</key>
    	<true/>
    	<key>ProgramArguments</key>
    	<array>
    		        <string>/bin/bash</string>
            <string>--login</string>
            <string>-c</string>
            <string>bin/teamcity-server.sh</string>
    		<string>run<sh run</string>
    	<    </array>
    	<key>RunAtLoad</key>
    	<true/>
    	<key>StandardErrorPath</key>
    	<string>logs/launchd.err.log</string>
    	<key>StandardOutPath</key>
    	<string>logs/launchd.out.log</string>
    </dict>
    </plist>
    
  3. Test your file by running launchctl load /Library/LaunchDaemons/jetbrains.teamcity.server.plist . This command should start the TeamCity server (you can see this from logs/teamcity-server.log and in your browser). 

  4. If you don't want TeamCity to start under the root permissions, specify the UserName key in the plist file, e.g.:

    Code Block
        <key>UserName</key>
    	<string>teamcity_user</string>
    

...