尝试在 RHEL5 上运行 god 时不允许进行操作

发布于 2024-11-14 15:28:08 字数 4967 浏览 4 评论 0原文

当我尝试在 RHEL5 机器上启动 god 时,出现以下错误。我还安装了 libevent 和 libevent-devel 软件包,但错误仍然存​​在。有人知道吗?

我修补了 ruby​​ 文件 https://github.com/mojombo/ god/blob/master/lib/god/event_handler.rb 包含 put $!.message 并将 $!.backtrace 放入 self.load 方法的救援异常块中以获得以下内容回溯。

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>'

我还在上帝日志文件中看到以下几行

***********************************************************************
*
* Event conditions are not available for your installation of god.
* You may still use and write custom conditions using the poll system
*
***********************************************************************

另外,下面是 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 `load'
(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 

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 `load'
(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 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

染墨丶若流云 2024-11-21 15:28:08

我意识到,由于 netlink_handler_ext 依赖性,上帝只能从 root 用户启动。所以即使你以非sudo用户的身份安装god gem,你仍然需要使用sudo来启动god。所以,我最后只好给rails用户分配root权限,并使用rvmsudo来启动god。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文