diff options
author | Michael Lee <michael.lee@zerustech.com> | 2013-02-12 19:01:55 +0400 |
---|---|---|
committer | Michael Lee <michael.lee@zerustech.com> | 2013-02-12 19:01:55 +0400 |
commit | 4c0c90865502e5a1c22933e51e53a1625d0bd61a (patch) | |
tree | 58662b93c30e5990fe21bf3b9d19ff70d6c6d006 /lib/tasks/sidekiq.rake | |
parent | 06dd530edecf90711c5bf7fe6918729a0096a572 (diff) |
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" ?
Diffstat (limited to 'lib/tasks/sidekiq.rake')
-rw-r--r-- | lib/tasks/sidekiq.rake | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/tasks/sidekiq.rake b/lib/tasks/sidekiq.rake index 67e8daafec7..cf99951e027 100644 --- a/lib/tasks/sidekiq.rake +++ b/lib/tasks/sidekiq.rake @@ -8,7 +8,12 @@ namespace :sidekiq do task :start do 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 &" end - + + desc "GITLAB | Start sidekiq with launchd on Mac OS X" + task :launchd do + 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" + end + def pidfile Rails.root.join("tmp", "pids", "sidekiq.pid") end |