Skip to content

Instantly share code, notes, and snippets.

@BenWhitehead
Created March 7, 2014 23:09
Show Gist options
  • Select an option

  • Save BenWhitehead/9422087 to your computer and use it in GitHub Desktop.

Select an option

Save BenWhitehead/9422087 to your computer and use it in GitHub Desktop.

Revisions

  1. BenWhitehead created this gist Mar 7, 2014.
    12 changes: 12 additions & 0 deletions teamcity-agent.service
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    [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
    13 changes: 13 additions & 0 deletions teamcity-server.service
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    [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