6 GITORIOUS_HOME
="/usr/share/webapps/gitorious"
7 BUNDLE
="/opt/ruby-enterprise/bin/bundle"
8 PID_FILE
="$GITORIOUS_HOME/tmp/pids/poller0.pid"
12 [ ! -f "$PIDFILE" ] && return 1
13 local PID
=$
(cat "$PIDFILE" 2> /dev
/null
)
14 [ -z "$PID" ] && return 1
15 if [ ! -d "/proc/$PID" ]; then
16 rm -f "$PIDFILE" 2> /dev
/null
24 if check_pid
"$PIDFILE"; then
25 local PID
=$
(cat "$PIDFILE" 2> /dev
/null
)
26 kill $PID &> /dev
/null
35 while check_pid
"$1"; do sleep 1; done
40 stat_busy
"Starting gitorious poller"
41 if [ ! -d "$GITORIOUS_HOME/tmp/pids" ]; then
42 mkdir
"$GITORIOUS_HOME/tmp/pids"
43 chown git
:git
"$GITORIOUS_HOME/tmp/pids"
45 check_pid
"$PID_FILE" || su
- git
-c "env RAILS_ENV=production $BUNDLE exec script/poller start" > /dev
/null
2>&1
49 add_daemon gitorious-poller
54 stat_busy
"Stopping gitorious poller"
55 if ! kill_pid
"$PID_FILE"; then
58 rm_daemon gitorious-poller
68 echo "usage: $0 {start|stop|restart}"