Operation not permitted when trying to run god on RHEL5
When i am trying to start god on RHEL5 box, am getting the following error. I have also installed libevent and libevent-devel packages, but the error persists. Does any one have any idea?
I patched the ruby file https://github.com/mojombo/god/blob/master/lib/god/event_handler.rb to include puts $!.message and puts $!.backtrace in the rescue Exception block of the self.load method to get the following backtrace.
Operation not permitted
/home/rails/public_html/my_app/shared/bundle/ruby/1.9.1/gems/god-0.11.0/lib/god/event_handlers/netlink_handler.rb:1:in `require'
/home/rails/public_html/my_app/shared/bundle/ruby/1.9.1/gems/god-0.11.0/lib/god/event_handlers/netlink_handler.rb:1:in `<top (required)>'
/home/rails/public_html/my_app/shared/bundle/ruby/1.9.1/gems/god-0.11.0/lib/god/event_handler.rb:22:in `require'
/home/rails/public_html/my_app/shared/bundle/ruby/1.9.1/gems/god-0.11.0/lib/god/event_handler.rb:22:in `load'
/home/rails/public_html/my_app/shared/bundle/ruby/1.9.1/gems/god-0.11.0/lib/god/cli/run.rb:54:in `default_run'
/home/rails/public_html/my_app/shared/bundle/ruby/1.9.1/gems/god-0.11.0/lib/god/cli/run.rb:100:in `block in run_daemonized'
/home/rails/public_html/my_app/shared/bundle/ruby/1.9.1/gems/god-0.11.0/lib/god/cli/run.rb:91:in `fork'
/home/rails/public_html/my_app/shared/bundle/ruby/1.9.1/gems/god-0.11.0/lib/god/cli/run.rb:91:in `run_daemonized'
/home/rails/public_html/my_app/shared/bundle/ruby/1.9.1/gems/god-0.11.0/lib/god/cli/run.rb:21:in `dispatch'
/home/rails/public_html/my_app/shared/bundle/ruby/1.9.1/gems/god-0.11.0/lib/god/cli/run.rb:8:in `initialize'
/home/rails/public_html/my_app/shared/bundle/ruby/1.9.1/gems/god-0.11.0/bin/god:122:in `new'
/home/rails/public_html/my_app/shared/bundle/ruby/1.9.1/gems/god-0.11.0/bin/god:122:in `<top (required)>'
/home/rails/public_html/my_app/shared/bundle/ruby/1.9.1/bin/god:19:in `load'
/home/rails/public_html/my_app/shared/bundle/ruby/1.9.1/bin/god:19:in `<main>'
I also see the following lines in the god log file
***********************************************************************
*
* Event conditions are not available for your installation of god.
* You may still use and write custom conditions using the poll system
*
***********************************************************************
Also, below is the output from IRB
[rails@x-rws1 current]$ RAILS_ENV=staging script/console
Loading staging environment (Rails 2.3.11)
irb: warn: can't alias exit from irb_exit.
ruby-1.9.2-p180 :001 > God::EventHandler.load
Operation not permitted
/home/rails/public_html/my_app/shared/bundle/ruby/1.9.1/gems/polyglot-0.3.1/lib/polyglot.rb:64:in `require'
/home/rails/public_html/my_app/shared/bundle/ruby/1.9.1/gems/polyglot-0.3.1/lib/polyglot.rb:64:in `require'
/home/rails/public_html/my_app/shared/bundle/ruby/1.9.1/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:184:in `require'
/home/rails/public_html/my_app/shared/bundle/ruby/1.9.1/gems/god-0.11.0/lib/god/event_handlers/netlink_handler.rb:1:in `<top (required)>'
/home/rails/public_html/my_app/shared/bundle/ruby/1.9.1/gems/polyglot-0.3.1/lib/polyglot.rb:64:in `require'
/home/rails/public_html/my_app/shared/bundle/ruby/1.9.1/gems/polyglot-0.3.1/lib/polyglot.rb:64:in `require'
/home/rails/public_html/my_app/shared/bundle/ruby/1.9.1/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:184:in `require'
/home/rails/public_html/my_app/shared/bundle/ruby/1.9.1/gems/god-0.11.0/lib/god/event_handler.rb:22:in `loa开发者_开发知识库d'
(irb):1:in `irb_binding'
/home/rails/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/irb/workspace.rb:80:in `eval'
/home/rails/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/irb/workspace.rb:80:in `evaluate'
/home/rails/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/irb/context.rb:254:in `evaluate'
/home/rails/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/irb.rb:159:in `block (2 levels) in eval_input'
/home/rails/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/irb.rb:273:in `signal_status'
/home/rails/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/irb.rb:156:in `block in eval_input'
/home/rails/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/irb/ruby-lex.rb:243:in `block (2 levels) in each_top_level_statement'
/home/rails/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in `loop'
/home/rails/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in `block in each_top_level_statement'
/home/rails/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/irb/ruby-lex.rb:228:in `catch'
/home/rails/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/irb/ruby-lex.rb:228:in `each_top_level_statement'
/home/rails/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/irb.rb:155:in `eval_input'
/home/rails/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/irb.rb:70:in `block in start'
/home/rails/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/irb.rb:69:in `catch'
/home/rails/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/irb.rb:69:in `start'
/home/rails/.rvm/rubies/ruby-1.9.2-p180/bin/irb:16:in `<main>'
=> false
I realized that god can only be started from a root user because of the netlink_handler_ext dependency. So even if you install the god gem as a non sudo user, you still have to use sudo to start god. So, I finally had to assign root privileges to the rails user and use rvmsudo to startup god.
精彩评论