Created
March 7, 2014 23:09
-
-
Save BenWhitehead/9422087 to your computer and use it in GitHub Desktop.
systemd service files for running TeamCity (create in /usr/lib/systemd/system)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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 |
I've tried multiple variations on the systemd unit file, but it still doesn't seem to want to update. Using @Sauraus's it just ends up in a restart loop, never actually finishing the upgrade. We need to always log in and manually start the service at least once with the agent.sh script in order for the upgrade to complete.
Does anyone have a functional unit file for this?
Edit:
The following seems to work for me:
[Unit]
Description=TeamCity Build Agent
After=network.target
[Service]
User=archiv
Type=forking
RemainAfterExit=yes
SuccessExitStatus=0 143
Restart=on-failure
PIDFile=/opt/BuildAgent_TC/buildAgent/logs/buildAgent.pid
ExecStart=/opt/BuildAgent_TC/buildAgent/bin/agent.sh start
ExecStop=/opt/BuildAgent_TC/buildAgent/bin/agent.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
@alst74: