Skip to content

Instantly share code, notes, and snippets.

@poul-kg
Last active November 11, 2015 09:33
Show Gist options
  • Save poul-kg/d0d9931f315459cf2b7f to your computer and use it in GitHub Desktop.
Save poul-kg/d0d9931f315459cf2b7f to your computer and use it in GitHub Desktop.
TeamCity build agent startup - Ubuntu 14.04 on AWS
#!/bin/sh
# /etc/init.d/buildagent
# # This will start TeamCity build agent on system startup as ubuntu user
# To run it on every system startup, execute:
# sudo update-rc.d buildagent defaults
case "$1" in
start)
echo "Starting TeamCity build agent "
start-stop-daemon --start --chuid ubuntu:ubuntu --quiet --exec /home/ubuntu/BuildAgent/bin/agent.sh start > /dev/null
;;
stop)
echo "Stopping TeamCity build agent"
/home/ubuntu/BuildAgent/bin/agent.sh stop > /dev/null
;;
*)
echo "Usage: /etc/init.d/buildagent {start|stop}"
exit 1
;;
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment