O mestre de marionetes não é executado sob nginx + configuração de passageiro como aplicativo de rack, funciona quando executado como serviço de sistema

2

Eu recebo o erro

[anadi@bangda ~]# tail -f /var/log/nginx/error.log 
[ pid=19741 thr=23597654217140 file=utils.rb:176 time=2012-09-17 12:52:43.307 ]: *** Exception LoadError in PhusionPassenger::Rack::ApplicationSpawner (no such file to load -- puppet/application/master) (process 19741, thread #<Thread:0x2aec83982368>):
    from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in 'gem_original_require'
    from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in 'require'
    from config.ru:13
    from /usr/local/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/builder.rb:51:in 'instance_eval'
    from /usr/local/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/builder.rb:51:in 'initialize'
    from config.ru:1:in 'new'
    from config.ru:1

quando eu inicio o servidor nginx com o módulo de passageiro configurado, o mestre de marionetes configurado para executar o rack.

aqui é o config.ru

[anadi@bangda ~]# cat /etc/puppet/rack/config.ru
# a config.ru, for use with every rack-compatible webserver.
# SSL needs to be handled outside this, though.

# if puppet is not in your RUBYLIB:
#$:.unshift('/usr/share/puppet/lib')

$0 = "master"

# if you want debugging:
# ARGV << "--debug"

ARGV << "--rack"
require 'puppet/application/master'
# we're usually running inside a Rack::Builder.new {} block,
# therefore we need to call run *here*.
run Puppet::Application[:master].run

e a configuração do nginx para o mestre de marionetes é a seguinte

[anadi@bangda ~]# cat /etc/nginx/conf.d/puppet-master.conf 
server {
  listen                     8140 ssl;
  server_name                bangda.mycompany.com;

  passenger_enabled          on;
  passenger_set_cgi_param    HTTP_X_CLIENT_DN $ssl_client_s_dn; 
  passenger_set_cgi_param    HTTP_X_CLIENT_VERIFY $ssl_client_verify; 

  access_log                 /var/log/nginx/puppet/master.access.log;
  error_log                  /var/log/nginx/puppet/master.error.log;

  root                       /etc/puppet/rack/public;

  ssl_certificate            /var/lib/puppet/ssl/certs/bangda.mycompany.com.pem;
  ssl_certificate_key        /var/lib/puppet/ssl/private_keys/bangda.mycompany.com.pem;
  ssl_crl                    /var/lib/puppet/ssl/ca/ca_crl.pem;
  ssl_client_certificate     /var/lib/puppet/ssl/certs/ca.pem;
  ssl_ciphers                SSLv2:-LOW:-EXPORT:RC4+RSA;
  ssl_prefer_server_ciphers  on;
  ssl_verify_client          optional;
  ssl_verify_depth           1;
  ssl_session_cache          shared:SSL:128m;
  ssl_session_timeout        5m;
}

no entanto, quando corro marionetes através do daemon puppetmasterd ususal, funciona perfeito sem erros.

Eu posso ver que a configuração do nginx + passageiro + rack falha ao inicializar enquanto o mesmo funciona ao executar o daemon natvie puppetmaster.

Alguma configuração que esteja faltando?

Atualização : Resolvido conseguiu que funcionasse graças ao comentário de @Shane Madden

fantoche está localizado em

/usr/lib/ruby/site_ruby/1.8/puppet/application/master.rb

enquanto libs ruby esperam que ele carregue de

/usr/local/lib/ruby/site_ruby/1.8/

daí mudou o config.ru assim

# a config.ru, for use with every rack-compatible webserver.
# SSL needs to be handled outside this, though.

# if puppet is not in your RUBYLIB:
$:.unshift('/usr/lib/ruby/site_ruby/1.8/')

$0 = "master"

# if you want debugging:
# ARGV << "--debug"

ARGV << "--rack"
require 'puppet/application/master'
# we're usually running inside a Rack::Builder.new {} block,
# therefore we need to call run *here*.
run Puppet::Application[:master].run

Funciona agora.

    
por Anadi Misra 17.09.2012 / 09:59

1 resposta

1

Resolvido funcionou graças ao comentário do @Shane Madden

fantoche está localizado em

/usr/lib/ruby/site_ruby/1.8/puppet/application/master.rb

enquanto libs ruby esperam que ele carregue de

/usr/local/lib/ruby/site_ruby/1.8/

daí mudou o config.ru assim

# a config.ru, for use with every rack-compatible webserver.
# SSL needs to be handled outside this, though.

# if puppet is not in your RUBYLIB:
$:.unshift('/usr/lib/ruby/site_ruby/1.8/')

$0 = "master"

# if you want debugging:
# ARGV << "--debug"

ARGV << "--rack"
require 'puppet/application/master'
# we're usually running inside a Rack::Builder.new {} block,
# therefore we need to call run *here*.
run Puppet::Application[:master].run

Funciona agora.

    
por 20.09.2012 / 11:34