Changeset View
Changeset View
Standalone View
Standalone View
contrib/teamcity/buildAgent-autostart
#!/bin/sh | #!/bin/sh | ||||
### BEGIN INIT INFO | ### BEGIN INIT INFO | ||||
# Provides: TeamCity Build Agent | # Provides: TeamCity Build Agent | ||||
# Required-Start: $remote_fs $syslog | # Required-Start: $remote_fs $syslog | ||||
# Required-Stop: $remote_fs $syslog | # Required-Stop: $remote_fs $syslog | ||||
# Default-Start: 2 3 4 5 | # Default-Start: 2 3 4 5 | ||||
# Default-Stop: 0 1 6 | # Default-Stop: 0 1 6 | ||||
# Short-Description: Start build agent daemon at boot time | # Short-Description: Start build agent daemon at boot time | ||||
# Description: Enable service provided by daemon. | # Description: Enable service provided by daemon. | ||||
### END INIT INFO | ### END INIT INFO | ||||
#Provide the correct user name: | #Provide the correct user name: | ||||
USER="teamcity" | USER="teamcity" | ||||
AGENT_PATH="~/buildAgent/bin" | |||||
case "$1" in | case "$1" in | ||||
start) | start) | ||||
su - $USER -c "cd ~/bin ; ./agent.sh start" | su - $USER -c "cd ${AGENT_PATH} ; ./agent.sh start" | ||||
;; | ;; | ||||
stop) | stop) | ||||
su - $USER -c "cd ~/bin ; ./agent.sh stop" | su - $USER -c "cd ${AGENT_PATH} ; ./agent.sh stop" | ||||
;; | |||||
status) | |||||
su - $USER -c "cd ${AGENT_PATH} ; ./agent.sh status" | |||||
;; | ;; | ||||
*) | *) | ||||
echo "usage start/stop" | echo "usage start/stop" | ||||
exit 1 | exit 1 | ||||
;; | ;; | ||||
esac | esac | ||||
exit 0 | exit 0 |