Commit cd675d9c authored by Ash McKenzie's avatar Ash McKenzie

Trap kill signal and call cleanup/stop

parent 0eb0e6a9
...@@ -8,6 +8,8 @@ sidekiq_pidfile="$app_root/tmp/pids/sidekiq-cluster.pid" ...@@ -8,6 +8,8 @@ sidekiq_pidfile="$app_root/tmp/pids/sidekiq-cluster.pid"
sidekiq_logfile="$app_root/log/sidekiq.log" sidekiq_logfile="$app_root/log/sidekiq.log"
gitlab_user=$(ls -l config.ru | awk '{print $3}') gitlab_user=$(ls -l config.ru | awk '{print $3}')
trap cleanup EXIT
warn() warn()
{ {
echo "$@" 1>&2 echo "$@" 1>&2
...@@ -59,6 +61,11 @@ start_sidekiq() ...@@ -59,6 +61,11 @@ start_sidekiq()
${cmd} bin/sidekiq-cluster "${processes_args[@]}" -P $sidekiq_pidfile -e $RAILS_ENV "$@" 2>&1 | tee -a $sidekiq_logfile ${cmd} bin/sidekiq-cluster "${processes_args[@]}" -P $sidekiq_pidfile -e $RAILS_ENV "$@" 2>&1 | tee -a $sidekiq_logfile
} }
cleanup()
{
stop
}
action="$1" action="$1"
shift shift
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment