3 # team_city_startup by Chris Koeritz
5 # /etc/init.d/team_city_startup
7 #uhhh... chkconfig: 2345 01 99
8 # description: starts the Team City Agent as our buildor user.
11 # Provides: team_city_startup
14 # Default-Start: 3 4 5
15 # Default-Stop: 0 1 2 6
16 # Short-Description: Team City Agent initialization
17 # Description: team city rc file. This rc script runs the agent as the
22 echo "Usage: $0 {start|stop|status|kill}"
25 function teamcity_action()
27 export JAVA_HOME=/usr/lib/jvm/java-6-sun
28 export HOME=/home/buildor
29 export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
31 # should become the buildor user and tell team city the proper action.
32 su -m -c "/home/buildor/teamcity_agent/bin/agent.sh $*" buildor
35 test -x ${PARSER} || exit 0 # by debian policy
47 teamcity_action stop kill
51 procs_found=$(ps wuax | grep teamcity | grep -v grep)
52 if [ -z "$procs_found" ]; then
53 echo "Team City Agent is not running."
55 echo "Team City Agent is running."