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 swbuild 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/swbuild
30 # should become the swbuild user and tell team city the proper action.
31 su -m -c "/home/swbuild/teamcity_agent/bin/agent.sh $*" swbuild
34 test -x ${PARSER} || exit 0 # by debian policy
46 teamcity_action stop kill
50 procs_found=$(ps wuax | grep teamcity | grep -v grep)
51 if [ -z "$procs_found" ]; then
52 echo "Team City Agent is not running."
54 echo "Team City Agent is running."