problems installing ruby-pdns

37 views
Skip to first unread message

Bursuc Sergiu

unread,
Feb 17, 2013, 12:24:30 AM2/17/13
to ruby-pd...@googlegroups.com
Hi,

I followed the wiki to set this up but I am having problems executing it.

I am running debian and installed ruby and all the necessary gems and packages. I used the ruby-pdns gem to install it.

When I execute:
/var/lib/gems/1.8/gems/ruby-pdns-0.5.1/sbin/pdns-aggregate-stats.rb
I get the following error:
/var/lib/gems/1.8/gems/ruby-pdns-0.5.1/sbin/pdns-aggregate-stats.rb:4:in `require': no such file to load -- pdns (LoadError)
        from /var/lib/gems/1.8/gems/ruby-pdns-0.5.1/sbin/pdns-aggregate-stats.rb:4

All the files are installed in /var/lib/gems/1.8/gems/ruby-pdns-0.5.1/

How do I get past this?

Please help
Thanks

R.I.Pienaar

unread,
Feb 17, 2013, 4:37:59 AM2/17/13
to ruby-pd...@googlegroups.com
error suggests it's not loaded rubygems or the path is wrong, generally
rubygems installs a wrapper in bin that does that.

same problem if you did

ruby -r rubygems /var/lib/gems/1.8/gems/ruby-pdns-0.5.1/sbin/pdns-aggregate-stats.rb

?

George

unread,
Feb 17, 2013, 11:38:09 AM2/17/13
to ruby-pd...@googlegroups.com
Sorry but this does not answer my question.

How do I make it run?

Thanks


2013/2/17 R.I.Pienaar <r...@devco.net>

?

--

---
You received this message because you are subscribed to the Google Groups "ruby-pdns-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-pdns-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.





--
Server Surgeon Support
sup...@serversurgeon.com
http://www.serversurgeon.com
System Administration Services
Toll Free 1-877-E-SURGEON (877-378-7436)
International 623-374-6848
Get the system support you need when you need it.

R.I.Pienaar

unread,
Feb 17, 2013, 12:58:19 PM2/17/13
to ruby-pd...@googlegroups.com


----- Original Message -----
> From: "George" <izg...@gmail.com>
> To: ruby-pd...@googlegroups.com
> Sent: Sunday, February 17, 2013 4:38:09 PM
> Subject: Re: [ruby-pdns-users] problems installing ruby-pdns
>
> Sorry but this does not answer my question.
>
> How do I make it run?

I gave you a command to run, if you don't want to do what you're asked and show what happens there really isn't anything I can do to help you.

George

unread,
Feb 17, 2013, 12:59:17 PM2/17/13
to ruby-pd...@googlegroups.com
Oh, sorry, I got confused

Here's the result of running that command:
root@debian:~# ruby -r rubygems /var/lib/gems/1.8/gems/ruby-pdns-0.5.1/sbin/pdns-aggregate-stats.rb
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- net/geoip (LoadError)
        from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from /var/lib/gems/1.8/gems/ruby-pdns-0.5.1/lib/pdns.rb:2
        from /usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
        from /usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `require'
        from /var/lib/gems/1.8/gems/ruby-pdns-0.5.1/sbin/pdns-aggregate-stats.rb:4

The geoip gem is installed already

Please advise
Thanks


2013/2/17 R.I.Pienaar <r...@devco.net>
--

---
You received this message because you are subscribed to the Google Groups "ruby-pdns-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-pdns-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


R.I.Pienaar

unread,
Feb 17, 2013, 1:03:12 PM2/17/13
to ruby-pd...@googlegroups.com


----- Original Message -----
> From: "George" <izg...@gmail.com>
> To: ruby-pd...@googlegroups.com
> Sent: Sunday, February 17, 2013 5:59:17 PM
> Subject: Re: [ruby-pdns-users] problems installing ruby-pdns
>
> Oh, sorry, I got confused
>
> Here's the result of running that command:
> root@debian:~# ruby -r rubygems
> /var/lib/gems/1.8/gems/ruby-pdns-0.5.1/sbin/pdns-aggregate-stats.rb
> /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require':
> no such file to load -- net/geoip (LoadError)
> from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
> from /var/lib/gems/1.8/gems/ruby-pdns-0.5.1/lib/pdns.rb:2
> from /usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in
> `gem_original_require'
> from /usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `require'
> from
> /var/lib/gems/1.8/gems/ruby-pdns-0.5.1/sbin/pdns-aggregate-stats.rb:4
>
> The geoip gem is installed already
>

seems not, in what path is it installed?

George

unread,
Feb 17, 2013, 1:03:57 PM2/17/13
to ruby-pd...@googlegroups.com
It's here:
/var/lib/gems/1.8/gems/geoip-1.2.1


2013/2/17 R.I.Pienaar <r...@devco.net>
--

---
You received this message because you are subscribed to the Google Groups "ruby-pdns-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-pdns-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


R.I.Pienaar

unread,
Feb 17, 2013, 2:32:26 PM2/17/13
to ruby-pd...@googlegroups.com


----- Original Message -----
> From: "George" <izg...@gmail.com>
> To: ruby-pd...@googlegroups.com
> Sent: Sunday, February 17, 2013 6:03:57 PM
> Subject: Re: [ruby-pdns-users] problems installing ruby-pdns
>
> It's here:
> /var/lib/gems/1.8/gems/geoip-1.2.1

The error says "no such file to load -- net/geoip"

Does this one have net/geoip? I dont think so, you probably need the net-geoip gem.

Read the errors, they tend to answer your questions

George

unread,
Feb 17, 2013, 7:51:17 PM2/17/13
to ruby-pd...@googlegroups.com
Ok, installing that helped.

Now I have trouble with pdns.conf:
Feb 17 19:49:02 debian pdns[16870]: Caught an exception instantiating a backend: Command '/usr/bin/ruby -r rubygems /usr/sbin/pdns-pipe-runner.rb' cannot be executed: No such file or directory

I used this in pdns.conf:
pipe-command="/usr/bin/ruby -r rubygems /usr/sbin/pdns-pipe-runner.rb"

Using it without "ruby -r rubygems" just throws the unknown pdns module

Please advise
Thanks


2013/2/17 R.I.Pienaar <r...@devco.net>


--

---
You received this message because you are subscribed to the Google Groups "ruby-pdns-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-pdns-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


George

unread,
Feb 18, 2013, 3:42:37 PM2/18/13
to ruby-pd...@googlegroups.com
Ok, I created a wrapper:
/usr/bin/ruby.wrapper with the contents:
#!/bin/bash
/usr/bin/ruby -r rubygems "$@"

changed first line of the ruby-pdns scripts to run the wrapper instead of the ruby binary. Powerdns starts properly:
Feb 18 15:35:30 debian pdns[10261]: Done launching threads, ready to distribute questions
Feb 18 15:35:30 debian pdns[10261]: Backend launched with banner: OK#011Ruby PDNS backend starting
Feb 18 15:35:30 debian pdns[10261]: gmysql Connection successful
Feb 18 15:35:30 debian pdns[10261]: Backend launched with banner: OK#011Ruby PDNS backend starting
Feb 18 15:35:30 debian pdns[10261]: Backend launched with banner: OK#011Ruby PDNS backend starting

pipe backend starts properly:
W, [2013-02-18T15:35:30.395195 #10269]  WARN -- : 10269 runner.rb:27:in `initialize': Runner starting
I, [2013-02-18T15:35:30.395331 #10269]  INFO -- : 10269 runner.rb:209:in `handshake': Ruby PDNS backend starting with PID 10269
W, [2013-02-18T15:35:30.395907 #10268]  WARN -- : 10268 runner.rb:27:in `initialize': Runner starting
I, [2013-02-18T15:35:30.396025 #10268]  INFO -- : 10268 runner.rb:209:in `handshake': Ruby PDNS backend starting with PID 10268
W, [2013-02-18T15:35:30.466366 #10272]  WARN -- : 10272 runner.rb:27:in `initialize': Runner starting
I, [2013-02-18T15:35:30.466535 #10272]  INFO -- : 10272 runner.rb:209:in `handshake': Ruby PDNS backend starting with PID 10272
W, [2013-02-18T15:35:30.467630 #10273]  WARN -- : 10273 runner.rb:27:in `initialize': Runner starting
I, [2013-02-18T15:35:30.467745 #10273]  INFO -- : 10273 runner.rb:209:in `handshake': Ruby PDNS backend starting with PID 10273
W, [2013-02-18T15:35:30.503240 #10278]  WARN -- : 10278 runner.rb:27:in `initialize': Runner starting
I, [2013-02-18T15:35:30.503372 #10278]  INFO -- : 10278 runner.rb:209:in `handshake': Ruby PDNS backend starting with PID 10278
W, [2013-02-18T15:35:30.557075 #10280]  WARN -- : 10280 runner.rb:27:in `initialize': Runner starting
I, [2013-02-18T15:35:30.557216 #10280]  INFO -- : 10280 runner.rb:209:in `handshake': Ruby PDNS backend starting with PID 10280
W, [2013-02-18T15:35:30.575551 #10283]  WARN -- : 10283 runner.rb:27:in `initialize': Runner starting
I, [2013-02-18T15:35:30.575670 #10283]  INFO -- : 10283 runner.rb:209:in `handshake': Ruby PDNS backend starting with PID 10283
W, [2013-02-18T15:35:30.645069 #10286]  WARN -- : 10286 runner.rb:27:in `initialize': Runner starting
I, [2013-02-18T15:35:30.645216 #10286]  INFO -- : 10286 runner.rb:209:in `handshake': Ruby PDNS backend starting with PID 10286
W, [2013-02-18T15:35:30.647796 #10289]  WARN -- : 10289 runner.rb:27:in `initialize': Runner starting
I, [2013-02-18T15:35:30.647906 #10289]  INFO -- : 10289 runner.rb:209:in `handshake': Ruby PDNS backend starting with PID 10289
W, [2013-02-18T15:35:30.682081 #10292]  WARN -- : 10292 runner.rb:27:in `initialize': Runner starting
I, [2013-02-18T15:35:30.682205 #10292]  INFO -- : 10292 runner.rb:209:in `handshake': Ruby PDNS backend starting with PID 10292

But the problem is that the test.test.com.rb record I added in the records directory is ignored:
module Pdns
  newrecord("test.test.com") do |query, answer|
    case country(query[:remoteip])
      when "US", "CA"
        answer.content "64.1.1.245"

      when "ZA", "ZW"
        answer.content "196.1.1.10"

      else
        answer.content "78.1.1.140"
      end
  end
end

Since my configs are in /usr/local/etc/ I edited all ruby-pdns related files and changed to match that location and any other locations necessary.

So now it starts but does not read any records. I checked and permissions are correct.

Please advise
Thanks


2013/2/18 George <izg...@gmail.com>

George

unread,
Feb 18, 2013, 6:51:55 PM2/18/13
to ruby-pd...@googlegroups.com
Ok, finally figured it out. The extension of the geo records should have been .prb

It finally works, thanks a lot for your help


2013/2/18 George <izg...@gmail.com>
Reply all
Reply to author
Forward
0 new messages