Personal tools
You are here: Home Software Development Continuous Integration TeamCity A systemd service configuration for Jetbrains Teamcity v2017

A systemd service configuration for Jetbrains Teamcity v2017

[Teamcity, systemd, service]

Executive summary: Use the 'run' option instead of the 'start' option.

Teamcity takes a while to start up. Using the conventional 'start' option requires a hand-off from the synchronous startup code (that starts the JVM and the Teamcity server) to the PID file. Timing issues means this doesn't always work as well as required. Using the 'rubn' option and letting systemd do the process management yields a simpler more robust solution.

Service file '/usr/lib/systemd/system/teamcity.service':

[Unit]
Description=JetBrains TeamCity
Requires=network.target
After=syslog.target network.target

[Service]
Type=simple
EnvironmentFile=/etc/sysconfig/teamcity
ExecStart=/srv/teamcity/teamcity/bin/teamcity-server.sh run
ExecStop=/srv/teamcity/teamcity/bin/teamcity-server.sh stop
User=teamcity

[Install]
WantedBy=multi-user.target

Note: Don't use the runAll.sh script as this runs both the server and the agent.

Links

 

Document Actions