Skip to content

Instantly share code, notes, and snippets.

@zakjan
Last active November 19, 2015 14:30
Show Gist options
  • Save zakjan/1c38762711a203c26e9d to your computer and use it in GitHub Desktop.
Save zakjan/1c38762711a203c26e9d to your computer and use it in GitHub Desktop.
TeamCity init scripts

TeamCity init scripts

Install: update-rc.d <job> defaults

Uninstall: update-rc.d <job> remove

Start: /etc/init.d/<job> start

Stop: /etc/init.d/<job> stop

#!/bin/sh
### BEGIN INIT INFO
# Provides: teamcity-agent
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
### END INIT INFO
USER=teamcity
TEAMCITY=/opt/TeamCity/buildAgent/bin/agent.sh
export TEAMCITY_AGENT_MEM_OPTS="-Xmx384m"
case $1 in
start)
start-stop-daemon --start -c $USER --exec $TEAMCITY start ;;
stop)
start-stop-daemon --start -c $USER --exec $TEAMCITY stop ;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac
#!/bin/sh
### BEGIN INIT INFO
# Provides: teamcity
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
### END INIT INFO
USER=teamcity
TEAMCITY=/opt/TeamCity/bin/teamcity-server.sh
export TEAMCITY_DATA_PATH="/home/teamcity/.BuildServer"
export TEAMCITY_SERVER_OPTS="-Djava.security.egd=file:/dev/./urandom"
export TEAMCITY_SERVER_MEM_OPTS="-Xmx4g -XX:MaxPermSize=270m"
case $1 in
start)
start-stop-daemon --start -c $USER --exec $TEAMCITY start ;;
stop)
start-stop-daemon --start -c $USER --exec $TEAMCITY stop ;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment