@@ -20,6 +20,7 @@ DAEMON_OPTS="-p 3000 -d -e production"
20
20
PID_PATH=" $APP_ROOT /tmp/pids"
21
21
THIN_PID=" $PID_PATH /thin.pid"
22
22
RESQUE_PID=" $PID_PATH /resque_worker.pid"
23
+ RESQUE_2_PID=" $PID_PATH /resque_schedule.pid"
23
24
NAME=" thin"
24
25
DESC=" Gitlab CI service"
25
26
@@ -42,8 +43,9 @@ start() {
42
43
exit 1
43
44
else
44
45
if [ ` whoami` = root ]; then
45
- sudo -u $USER -H sh -l -c " nohup bundle exec thin start $DAEMON_OPTS > /dev/null 2>&1 &"
46
- sudo -u $USER -H sh -l -c " mkdir -p $PID_PATH && nohup bundle exec rake environment resque:work QUEUE=runner RAILS_ENV=production PIDFILE=$RESQUE_PID > /dev/null 2>&1 &"
46
+ sudo -u $USER -H bash -l -c " bundle exec thin start $DAEMON_OPTS "
47
+ sudo -u $USER -H bash -l -c " nohup bundle exec rake environment resque:work QUEUE=runner,scheduler_task RAILS_ENV=production PIDFILE=tmp/pids/resque_worker.pid > ./log/resque.log &"
48
+ sudo -u $USER -H bash -l -c " nohup bundle exec rake environment resque:scheduler RAILS_ENV=production PIDFILE=tmp/pids/resque_schedule.pid > ./log/schedule.log &"
47
49
echo " $DESC started"
48
50
fi
49
51
fi
@@ -56,6 +58,7 @@ stop() {
56
58
# # Program is running, stop it.
57
59
kill -QUIT ` cat $THIN_PID `
58
60
kill -QUIT ` cat $RESQUE_PID `
61
+ kill -QUIT ` cat $RESQUE_2_PID `
59
62
rm " $THIN_PID " >> /dev/null
60
63
rm " $RESQUE_PID " >> /dev/null
61
64
echo " $DESC stopped"
@@ -72,7 +75,8 @@ restart() {
72
75
if [ " $PID " -ne 0 -a " $STATUS " -ne 0 ]; then
73
76
echo -n " Restarting $DESC : "
74
77
kill -USR2 ` cat $THIN_PID `
75
- kill -USR2 ` cat $RESQUE_PID `
78
+ kill -QUIT ` cat $RESQUE_PID `
79
+ kill -QUIT ` cat $RESQUE_2_PID `
76
80
echo " $NAME ."
77
81
else
78
82
echo " Error, $NAME not running!"
0 commit comments