Created
March 11, 2014 00:22
-
-
Save lukehutton/9477210 to your computer and use it in GitHub Desktop.
TeamCity Build Agent Start Script
This file contains hidden or 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
#! /bin/sh | |
# /etc/init.d/teamcity-agent | |
# Common parameters, do not edit: | |
PATH=/sbin:/usr/sbin:/bin:/usr/bin | |
DESC="TeamCity Agent" | |
NAME=teamcity-agent | |
SCRIPTNAME=/etc/init.d/$NAME | |
# | |
# User specific parameters: | |
USERNAME=teamcity | |
GROUP=teamcity | |
AGENT_HOME=~$USERNAME/agent | |
# | |
. /lib/init/vars.sh | |
. /lib/lsb/init-functions | |
case "$1" in | |
start) | |
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" | |
sudo -H -u $USERNAME /bin/bash --login -c "$AGENT_HOME/bin/agent.sh start" | |
;; | |
stop) | |
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" | |
sudo -H -u $USERNAME /bin/bash --login -c "$AGENT_HOME/bin/agent.sh stop" | |
;; | |
*) | |
echo "Usage: $SCRIPTNAME {start|stop}" >&2 | |
exit 3 | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment