Skip to content

Instantly share code, notes, and snippets.

@danischroeter
Created November 18, 2016 13:01
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danischroeter/0750168294c5b1f3355fa5539c871df5 to your computer and use it in GitHub Desktop.
Save danischroeter/0750168294c5b1f3355fa5539c871df5 to your computer and use it in GitHub Desktop.
Teamcity Server / Agent with SystemD in CentOs
JAVA_HOME=/usr/java/default
JAVA_OPTS="-server -Dfile.encoding=utf-8 -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses=true -Djava.awt.headless=true"
TEAMCITY_AGENT_MEM_OPTS="-Xmx3072m"
TEAMCITY_AGENT_OPTS=""
# TEAMCITY_LAUNCHER_OPTS Set agent launcher JVM options
# TEAMCITY_AGENT_PREPARE_SCRIPT name of a script to execute before start/stop
JAVA_HOME=/usr/java/default
JAVA_OPTS="-server -Dfile.encoding=utf-8 -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses=true -Djava.awt.headless=true"
TEAMCITY_DATA_PATH=/opt/teamcity/data
TEAMCITY_SERVER_MEM_OPTS="-Xmx2048m"
TEAMCITY_SERVER_OPTS=""
# TEAMCITY_PREPARE_SCRIPT name of a script to execute before start/stop
TEAMCITY_PID_FILE_PATH=/opt/teamcity/run/teamcity.pid
[Unit]
Description=TeamCity Build Agent
After=network.target
[Service]
Type=oneshot
RemainAfterExit=true
User=tca
EnvironmentFile=/etc/sysconfig/tca
ExecStart=/opt/tca/bin/agent.sh start
ExecStop=-/opt/tca/bin/agent.sh stop force
SuccessExitStatus=0 143
[Install]
WantedBy=default.target
[Unit]
Description=TeamCity Server
After=network.target
[Service]
Type=forking
PIDFile=/opt/teamcity/run/teamcity.pid
EnvironmentFile=/etc/sysconfig/teamcity
User=teamcity
ExecStart=/opt/teamcity/current/bin/teamcity-server.sh start
ExecStop=/opt/teamcity/current/bin/teamcity-server.sh stop
[Install]
WantedBy=multi-user.target
@armarti
Copy link

armarti commented Feb 19, 2017

You have a hyphen after ExecStop here, is that intentional?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment