[Pdns-users] Launch single Backend multiple times
Mario Manno
powerdns-list at mm.42h.de
Mon Jan 17 03:53:03 UTC 2005
I happily converted to powerdns 2.9.16 and tried a setup suitable for
multiple users.
Basically I want to launch the sqlite backend multiple times
(docs/html/modules.html), but there seems to be a problem with the
config file.
launch=gsqlite:user1,gsqlite:user2
gsqlite-user1-database=/var/lib/pdns/user1.db
gsqlite-user2-database=/var/lib/pdns/user2.db
This did not work, to confirm the problem i tried:
launch=gsqlite:one
gsqlite-one-database=/var/lib/pdns/db
And i get an error:
Undefined but needed argument: 'gsqliteone--basic-query'
After adding "gsqliteone--basic-query" to the config:
Fatal error: Trying to set unexisting parameter
'gsqliteone--basic-query'
If i add "gsqlite-one-basic-query" the undefined argument error happens
again.
I took a deeper look and came up with a patch.
Looks like it wont break anything...
Now I can use multiple instances of the sqlite backend.
--- pdns-2.9.16.org/pdns/backends/gsql/gsqlbackend.cc 2004-01-16
23:18:12.000000000 +0100
+++ pdns-2.9.16/pdns/backends/gsql/gsqlbackend.cc 2005-01-11
03:27:29.000000000 +0100
@@ -212,7 +212,7 @@
GSQLBackend::GSQLBackend(const string &mode, const string &suffix)
{
- setArgPrefix(mode+suffix);
+ setArgPrefix(mode+"-"+suffix);
d_db=0;
d_logprefix="["+mode+"Backend"+suffix+"] ";
diff -Nau -r pdns-2.9.16.org/pdns/dnsbackend.cc
pdns-2.9.16/pdns/dnsbackend.cc
--- pdns-2.9.16.org/pdns/dnsbackend.cc 2003-10-24 19:33:55.000000000
+0200
+++ pdns-2.9.16/pdns/dnsbackend.cc 2005-01-11 03:24:53.000000000
+0100
@@ -54,7 +54,7 @@
const string &DNSBackend::getArg(const string &key)
{
- return arg()[d_prefix+"-"+key];
+ return arg()[d_prefix+key];
}
int DNSBackend::getArgAsNum(const string &key)
mfg
Mario Manno
More information about the Pdns-users
mailing list