Skip to content

Instantly share code, notes, and snippets.

@abelardojarab
Forked from BenWhitehead/teamcity-agent.service
Created October 23, 2019 21:07
Show Gist options
  • Save abelardojarab/e2cf48ec0ca57dee747a7c28b6e053ad to your computer and use it in GitHub Desktop.
Save abelardojarab/e2cf48ec0ca57dee747a7c28b6e053ad to your computer and use it in GitHub Desktop.
systemd service files for running TeamCity (create in /usr/lib/systemd/system)
[Unit]
Description=TeamCity Build Agent
After=network.target
[Service]
Type=forking
PIDFile=$AGENT_HOME/logs/buildAgent.pid
ExecStart=/usr/bin/sudo -u teamcity $AGENT_HOME/bin/agent.sh start
ExecStop=/usr/bin/sudo -u teamcity $AGENT_HOME/bin/agent.sh stop
[Install]
WantedBy=multi-user.target
[Unit]
Description=TeamCity Server
After=network.target
[Service]
Type=forking
PIDFile=$TEAMCITY_HOME/logs/teamcity-server.pid
; Make sure the CATALINA_PID env variable is setup in $TEAMCITY_HOME/bin/catalina.sh
ExecStart=/usr/bin/sudo -u teamcity $TEAMCITY_HOME/bin/teamcity-server.sh start
ExecStop=/usr/bin/sudo -u teamcity $TEAMCITY_HOME/bin/teamcity-server.sh stop
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment