Commit 4c0c90865502e5a1c22933e51e53a1625d0bd61a

Authored by Michael Lee
1 parent 06dd530e

Update lib/tasks/sidekiq.rake

Mac OS uses launchd instead of /etc/init.d to start daemons and tasks to be started by launchd MUST NOT daemon itself. So "nohup" here won't work for Mac OS. 

Can we add a "launchd" task to the rake file so that we can start sidekiq as "bundle exec rake sidekiq:launchd" ?
Showing 1 changed file with 6 additions and 1 deletions   Show diff stats
lib/tasks/sidekiq.rake
... ... @@ -8,7 +8,12 @@ namespace :sidekiq do
8 8 task :start do
9 9 run "nohup bundle exec sidekiq -q post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default -e #{Rails.env} -P #{pidfile} >> #{Rails.root.join("log", "sidekiq.log")} 2>&1 &"
10 10 end
11   -
  11 +
  12 + desc "GITLAB | Start sidekiq with launchd on Mac OS X"
  13 + task :launchd do
  14 + run "bundle exec sidekiq -q post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default -e #{Rails.env} -P #{pidfile} >> #{Rails.root.join("log", "sidekiq.log")} 2>&1"
  15 + end
  16 +
12 17 def pidfile
13 18 Rails.root.join("tmp", "pids", "sidekiq.pid")
14 19 end
... ...