[Resolved] rufus-scheduler on nginx/passenger is not doing anything
Added by Olivier Keun over 8 years ago
When i enable rufus-scheduler it doesn't seem to do anything, it also doesn't output any noticeable errors. Fetching mail works fine through regular cron. How can i debug this?
redmine: 3.0.3
nginx: 1.8.0
fusion passenger: 5.0.10
rufus-scheduler: 3.1.3
/config/initializers/fetchmail.rb
require 'rubygems' require 'rake' require 'rufus-scheduler' load File.join(Rails.root, 'Rakefile') ENV['host']='imap.gmail.com' ENV['port']='993' ENV['ssl']='SSL' ENV['username']='<username>' ENV['password']='<password>' ENV['move_on_success']='Success' ENV['move_on_failure']='Failed' scheduler = Rufus::Scheduler.new scheduler.interval '5m' do task = Rake.application['redmine:email:receive_imap'] task.reenable task.invoke end
Restart:
[ 2015-07-03 14:00:40.2559 3801/7fb96742b740 age/Wat/Main.cpp:1293 ]: Starting PassengerAgent watchdog... [ 2015-07-03 14:00:40.2614 3804/7f18d68c1740 age/Hel/Main.cpp:957 ]: Starting PassengerAgent server... [ 2015-07-03 14:00:40.2616 3804/7f18d68c1740 age/Hel/Main.cpp:234 ]: PassengerAgent server running in multi-application mode. [ 2015-07-03 14:00:40.2630 3804/7f18d68c1740 age/Hel/Main.cpp:707 ]: PassengerAgent server online, PID 3804 [ 2015-07-03 14:00:40.2686 3809/7fa218249740 age/Log/Main.cpp:430 ]: Starting PassengerAgent logger... [ 2015-07-03 14:00:40.2692 3809/7fa218249740 age/Log/Main.cpp:311 ]: PassengerAgent logger online, PID 3809 App 3848 stdout: App 3848 stderr: sh: 1: App 3848 stderr: env: not found App 3848 stderr: App 3865 stdout:
I'm not sure what the env: not found message above means, but it also appears without rufus-scheduler enabled so i suspect it is unrelated.
Thanks for any insight!
Replies (1)
RE: rufus-scheduler on nginx/passenger is not doing anything
-
Added by Olivier Keun over 8 years ago
Resolved: this was apparently caused by passenger's default spawning method. Adding this to the server block in the nginx config fixed it:
passenger_spawn_method direct;
I do wonder however if the performance penalty for using direct spawning makes using rufus-scheduler really worthwhile.