Created
October 25, 2019 00:17
-
-
Save dcomartin/a8d25bc2e72a697af4cfa0b7fb4a082e to your computer and use it in GitHub Desktop.
This file contains 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 | |
### BEGIN INIT INFO | |
# Provides: TeamCity Build Agent | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Start build agent daemon at boot time | |
# Description: Enable service provided by daemon. | |
### END INIT INFO | |
#Provide the correct user name: | |
USER="agentuser" | |
case "$1" in | |
start) | |
su - $USER -c "cd /path/to/buildAgent/bin ; ./agent.sh start" | |
;; | |
stop) | |
su - $USER -c "cd /path/to/buildAgent/bin ; ./agent.sh stop" | |
;; | |
*) | |
echo "usage 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