passenger not accepting alternate config file

105 views
Skip to first unread message

John Warburton

unread,
Nov 19, 2009, 11:27:11 PM11/19/09
to puppet...@googlegroups.com

Hi All

First up I have puppet (0.25.1), ruby (1.8.7p174), facter (1.5.7) on RHEl 5.1 all in non standard locations - but can get puppetmasterd running with WEBrick

puppet@linux% echo $RUBYLIB
/apps/puppet/puppet/lib:/apps/puppet/facter/lib

puppet@linux% echo $PATH
/apps/puppet/ruby/bin:/apps/puppet/puppet/bin:/apps/puppet/facter/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/ccs/bin:/usr/bin:/usr/sbin:/bin:/sbin

puppet@linux% /apps/puppet/puppet/sbin/puppetmasterd --config /tmp/puppetmasterd.genconfig --no-daemonize --verbose
notice: Starting Puppet server version 0.25.1

However, trying to move to passenger (2.2.2), it rejects my option of an alternate config file. I am pretty sure I am missing a path definition, but for the life of me can't work it out. (configuration details at end of post)

root@linux# tail -f /etc/httpd/logs/error_log
[Fri Nov 20 03:54:27 2009] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads.
[Fri Nov 20 03:54:27 2009] [notice] Apache/2.2.3 (Red Hat) configured -- resuming normal operations
invalid option: --config /tmp/puppetmasterd.genconfig
Try 'puppetmasterd --help'
[ pid=1781 file=ext/common/ApplicationPoolServerExecutable.cpp:307 time=2009-11-20 03:54:46.775 ]:
  Client 0x34375e0: SpawnException occured (with error page)

If I remove the --config option from config.ru, puppetmaster complains (quite rightly /etc/puppet & /var/puppet are missing, because I have set them somewhere else). If I add other options like "--vardir=/data/puppet/var --confdir=/data/puppet/etc", I get the same sort of error


Any pointers in debugging Passenger or Puppet at this level would be appreciated


Thanks


John



puppet@linux% ls -l /data/puppet/etc/rack/config.ru
-rw-r--r-- 1 puppet _puppet 833 Nov 20 04:15 /data/puppet/etc/rack/config.ru

config.ru:
$:.unshift('/apps/puppet/puppet/lib')
$:.unshift('/apps/puppet/facter/lib')
$0 = "puppetmasterd"
require 'puppet'
ARGV << "--debug"
ARGV << "--verbose"
ARGV << "--rack"
ARGV << "--config /tmp/puppetmasterd.genconfig"
require 'puppet/application/puppetmasterd'
run Puppet::Application[:puppetmasterd].run

(I've also tried commenting out the "require puppet")

puppet@linux% lynx https://puppet-esx-rmc.domain.com:8140/
   Application root:
          /data/puppet/etc/rack

   Backtrace:

   # File Line Location
   0 /apps/puppet/puppet/lib/puppet/application.rb 266 in `exit'
   1 /apps/puppet/puppet/lib/puppet/application.rb 266 in `parse_options'
   2 /apps/puppet/puppet/lib/puppet/application.rb 214 in `run'
   3 /apps/puppet/puppet/lib/puppet/application.rb 306 in `exit_on_fail'
   4 /apps/puppet/puppet/lib/puppet/application.rb 214 in `run'
   5 config.ru 23
   6 /apps/puppet/ruby-1.8.7-p174-x86_64/lib/ruby/gems/1.8/gems/passenger-2.2.2/vendor/rack-1.0.0-git/lib/rack/builder.rb 29 in `instance_eval'
   7 /apps/puppet/ruby-1.8.7-p174-x86_64/lib/ruby/gems/1.8/gems/passenger-2.2.2/vendor/rack-1.0.0-git/lib/rack/builder.rb 29 in `initialize'
   8 config.ru 1 in `new'
   9 config.ru 1


puppet@linux% gem list

*** LOCAL GEMS ***

fastthread (1.0.7)
passenger (2.2.2)
rack (1.0.1)
rake (0.8.7)


root@linux#  cat /etc/httpd/conf.d/puppetmasterd.conf

# you probably want to tune these settings
PassengerHighPerformance on
PassengerMaxPoolSize 12
PassengerPoolIdleTime 1500
# PassengerMaxRequests 1000
PassengerStatThrottleRate 120
RackAutoDetect Off
RailsAutoDetect Off

PassengerLogLevel 3

Listen 8140

<VirtualHost *:8140>
        ServerName puppet-esx-rmc.domain.com
        LoadModule passenger_module /apps/puppet/ruby-1.8.7-p174-x86_64/lib/ruby/gems/1.8/gems/passenger-2.2.2/ext/apache2/mod_passenger.so
        PassengerRoot /apps/puppet/ruby-1.8.7-p174-x86_64/lib/ruby/gems/1.8/gems/passenger-2.2.2
        PassengerRuby /apps/puppet/ruby-1.8.7-p174-x86_64/bin/ruby

        SSLEngine on
        SSLProtocol -ALL +SSLv3 +TLSv1
        SSLCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:-LOW:-SSLv2:-EXP

        SSLCertificateFile      /data/puppet/etc/ssl/certs/puppet-esx-rmc.domain.com.pem
        SSLCertificateKeyFile   /data/puppet/etc/ssl/private_keys/puppet-esx-rmc.domain.com.pem
        SSLCertificateChainFile /data/puppet/etc/ssl/ca/ca_crt.pem
        SSLCACertificateFile    /data/puppet/etc/ssl/ca/ca_crt.pem
        # If Apache complains about invalid signatures on the CRL, you can try disabling
        # CRL checking by commenting the next line, but this is not recommended.
        SSLCARevocationFile     /data/puppet/etc/ssl/ca/ca_crl.pem
        SSLVerifyClient optional
        SSLVerifyDepth  1
        SSLOptions +StdEnvVars

        DocumentRoot /data/puppet/etc/rack/public/
        RackBaseURI /
        <Directory /data/puppet/etc/rack/>
                Options None
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>
</VirtualHost>

Christian Hofstaedtler

unread,
Nov 20, 2009, 6:40:09 AM11/20/09
to Puppet Users

> config.ru:
> $:.unshift('/apps/puppet/puppet/lib')
> $:.unshift('/apps/puppet/facter/lib')
> $0 = "puppetmasterd"
> require 'puppet'
> ARGV << "--debug"
> ARGV << "--verbose"
> ARGV << "--rack"
> ARGV << "--config /tmp/puppetmasterd.genconfig"

Did you try with this? ->
ARGV << "--config"
ARGS << "/tmp/puppetmasterd.genconfig"


Christian

Nigel Kersten

unread,
Nov 20, 2009, 11:09:35 AM11/20/09
to puppet...@googlegroups.com
I can confirm that I'm doing this and it Works For Me.


>
>
>  Christian
>
> --
>
> You received this message because you are subscribed to the Google Groups "Puppet Users" group.
> To post to this group, send email to puppet...@googlegroups.com.
> To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/puppet-users?hl=.
>
>
>



--
nigel

John Warburton

unread,
Nov 21, 2009, 3:35:39 AM11/21/09
to puppet...@googlegroups.com
Thanks Guys

But it didn't seem to like ARGS. Is it set in rack or passenger or ??

Can I amp up the debugging here?

Cheers

John


config.ru:

$:.unshift('/apps/puppet/puppet/lib')
$:.unshift('/apps/puppet/facter/lib')
$0 = "puppetmasterd"
require 'puppet'
ARGV << "--debug"
ARGV << "--verbose"
ARGV << "--rack"
ARGV << "--config"
ARGS << "/tmp/puppetmasterd.genconfig"

require 'puppet/application/puppetmasterd'
run Puppet::Application[:puppetmasterd].run

   Error message:
          uninitialized constant ARGS

   Exception class:
          NameError


   Application root:
          /data/puppet/etc/rack

   Backtrace:

   # File Line Location
   0 config.ru 19
   1 /apps/puppet/ruby-1.8.7-p174-x86_64/lib/ruby/gems/1.8/gems/passenger-2.2.2/vendor/rack-1.0.0-git/lib/rack/builder.rb 29 in
   `instance_eval'
   2  /apps/puppet/ruby-1.8.7-p174-x86_64/lib/ruby/gems/1.8/gems/passenger-2.2.2/vendor/rack-1.0.0-git/lib/rack/builder.rb  29  in
   `initialize'
   3 config.ru 1 in `new'
   4 config.ru 1


2009/11/21 Nigel Kersten <nig...@google.com>



--
John Warburton
Ph: 0417 299 600
Email: jwarb...@gmail.com

Scott Smith

unread,
Nov 21, 2009, 4:10:52 PM11/21/09
to puppet...@googlegroups.com
John Warburton wrote:
> Thanks Guys
>
> But it didn't seem to like ARGS. Is it set in rack or passenger or ??
>
> Can I amp up the debugging here?
>

Have you tried this?

ARGV << "--config=/tmp/puppetmasterd.genconfig"

-scott

John Warburton

unread,
Nov 22, 2009, 7:04:04 PM11/22/09
to puppet...@googlegroups.com
2009/11/22 Scott Smith <sc...@ohlol.net>

Ah, now that works! Thanks Scott

On to debugging file metadata issues:
Failed to retrieve current state of resource: undefined method `name=' for #<Puppet::FileServing::Metadata:0xb6f2bf28> Could not retrieve file metadata for puppet:///modules/security/var/tmp/krb5-workstation-1.2.7-70.i386.rpm

Thanks all that took a look

Regards

John

Nigel Kersten

unread,
Nov 23, 2009, 1:59:58 PM11/23/09
to puppet...@googlegroups.com
On Sun, Nov 22, 2009 at 4:04 PM, John Warburton <jwarb...@gmail.com> wrote:
> 2009/11/22 Scott Smith <sc...@ohlol.net>
>>
>> John Warburton wrote:
>> > Thanks Guys
>> >
>> > But it didn't seem to like ARGS. Is it set in rack or passenger or ??
>> >
>> > Can I amp up the debugging here?
>> >
>>
>> Have you tried this?
>>
>> ARGV << "--config=/tmp/puppetmasterd.genconfig"
>>
>> -scott
>>
>
> Ah, now that works! Thanks Scott

Sorry for misreading the email earlier, what I'm actually doing is:

ARGV << "--config" << "/etc/puppet/puppetmasterd.conf"

I was under the impression we weren't meant to use "=" in puppet
config settings, but I could be wrong.



>
> On to debugging file metadata issues:
> Failed to retrieve current state of resource: undefined method `name=' for
> #<Puppet::FileServing::Metadata:0xb6f2bf28> Could not retrieve file metadata
> for puppet:///modules/security/var/tmp/krb5-workstation-1.2.7-70.i386.rpm
>
> Thanks all that took a look
>
> Regards
>
> John
>

Scott Smith

unread,
Nov 23, 2009, 7:18:38 PM11/23/09
to puppet...@googlegroups.com
Nigel Kersten wrote:
> I was under the impression we weren't meant to use "=" in puppet
> config settings, but I could be wrong.
>

Eh, it just uses optparse to read command-line flags, which accepts the
use of an equals sign.

-scott

John Warburton

unread,
Nov 23, 2009, 9:02:16 PM11/23/09
to puppet...@googlegroups.com
Thanks Nigel

2009/11/24 Nigel Kersten <nig...@google.com>


Sorry for misreading the email earlier, what I'm actually doing is:

ARGV << "--config" << "/etc/puppet/puppetmasterd.conf"


This now works

Part of the problem debugging this was:
1) My lack of knowledge of ruby
2) I had kept caches, files etc on client & server from when running Webrick which confused things no end
3) My naive expectation connecting to passenger via a web browser would produce something useful

Cheers

John
Reply all
Reply to author
Forward
0 new messages