Methods in components not found when ahn run as a daemon
Reported by jsgoecke | February 4th, 2009 @ 02:19 PM
I may create an ahn app and use the simon_game module as a component when I run ahn interactively. But as soon as I run as a daemon with 'ahnctl start foo' I get this error:
ERROR agi: #<NameError: undefined local variable or method
simon_game' for
#<Adhearsion::DialPlan::ExecutionEnvironment:0x19021e8>>
ERROR agi:
/Users/jsgoecke/Desktop/foo/dialplan.rb:2:in
load'
/opt/adhearsion/lib/adhearsion/voip/dial_plan.rb:50:in `instance_eval'
/opt/adhearsion/lib/adhearsion/voip/dial_plan.rb:50:in `run'
/opt/adhearsion/lib/adhearsion/voip/dial_plan.rb:105:in `handle'
/opt/adhearsion/lib/adhearsion/voip/dial_plan.rb:81:in `handle'
/opt/adhearsion/lib/adhearsion/voip/asterisk/agi_server.rb:23:in `serve'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/gserver.rb:211:in `start'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/gserver.rb:208:in `initialize'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/gserver.rb:208:in `new'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/gserver.rb:208:in `start'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/gserver.rb:198:in `initialize'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/gserver.rb:198:in `new'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/gserver.rb:198:in `start'
/opt/adhearsion/lib/adhearsion/voip/asterisk/agi_server.rb:66:in `start'
/opt/adhearsion/lib/adhearsion/initializer/asterisk.rb:56:in `join_server_thread_after_initialized'
/opt/adhearsion/lib/theatre.rb:66:in `call'
/opt/adhearsion/lib/theatre.rb:66:in `trigger_immediately'
/opt/adhearsion/lib/theatre.rb:63:in `map'
/opt/adhearsion/lib/theatre.rb:63:in `trigger_immediately'
/opt/adhearsion/lib/adhearsion/events_support.rb:47:in `trigger_immediately'
/opt/adhearsion/lib/adhearsion/initializer.rb:349:in `trigger_after_initialized_hooks'
/opt/adhearsion/lib/adhearsion/initializer.rb:143:in `start'
/opt/adhearsion/lib/adhearsion/initializer.rb:92:in `start'
/opt/adhearsion/lib/adhearsion/cli.rb:129:in `start'
/opt/adhearsion/lib/adhearsion/cli.rb:19:in `send'
/opt/adhearsion/lib/adhearsion/cli.rb:19:in `execute!'
/opt/adhearsion/bin/ahn:28
Comments and changes to this ticket
-
Preston Marshall February 4th, 2009 @ 10:26 PM
Have we considered using Daemonize for the daemon start/stop? Or is it too simple for what we need to do to start Adhearsion?
-
jsgoecke February 4th, 2009 @ 11:42 PM
The adhearsion/foundation/custom_daemonizer.rb is largely the same as the http://daemons.rubyforge.org safefork and daemonize methods. Just cleaned up.
There is something happening when the process gets forked and detached from the terminal that is causing components to break.
-
jsgoecke February 4th, 2009 @ 11:57 PM
Tested and fixed this issue on my Adhearsion fork:
http://github.com/jsgoecke/adhea...
Did a pull request of the patch to Jicksta.
-
Jason Goecke February 6th, 2009 @ 07:15 PM
- State changed from new to resolved
- Milestone cleared.
Fixed and will be released in v0.8.2 gem.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป