I probably should have said that I'm using the following options in m config-file
- setuid
- setgid

Which might explain the problem I saw before my hack. No problems have
been seen after my modification.

I've attached a patch-file which contains the changes as I made them. I hope it
comes through to the list.

Regards,

Ton

Ton van Rosmalen schreef:
Hi again,

Ton van Rosmalen schreef:
  
I just downgraded the supermaster back to 2.9.21 and pdns_control
functions as it should.
It connects to the control-socket send the notify and exits.

When shutting down using the pdns-initscript it hung on 'pdns_control
ping', so all usage of the
control socket seems to give me problems.

Is there anything I can test to provide more info on this issue I'm
seeing?
    
After looking into the code and the diffs between 2.9.21 and the
snapshot I found the only difference
between the old and new in the manner in which the control-socket is
set-up in the server.

In 2.9.21 only the local unix socket existed and this was set-up.
In 2.9.22 both the local unix socket and a tcp/ip socket exist for which
a shared function
is create b the name 'createSocketAndBind'.

The problem seems to be that this function essentially does a bind() and
listen() after which the gid and mode
of the control-socket is changed.

Before it did a bind(), change gid/mode and listen().

I did a quick hack to change behaviour as it was in 2.9.21 and
pdns_control does everything I want it to.

At this time I'm getting a bit cloudy in my head ;-) so if I don't make
sense please forgive me.

If the hack I made is of interest to anyone please let me know and I'll
post a diff against snapshot 1293 to the list.

Regards,

Ton
_______________________________________________
Pdns-users mailing list
[email protected]
http://mailman.powerdns.com/mailman/listinfo/pdns-users
  
Index: dynlistener.cc
===================================================================
--- dynlistener.cc      (revision 1294)
+++ dynlistener.cc      (working copy)
@@ -74,8 +74,6 @@
     L<<Logger::Critical<<"Binding to dynlistener: "<<strerror(errno)<<endl;
     exit(1);
   }
-
-  listen(d_s,10);
 }
 
 void DynListener::listenOnUnixDomain(const string& fname)
@@ -100,6 +98,7 @@
       L<<Logger::Error<<"Unable to change group access mode of controlsocket: 
"<<strerror(errno)<<endl;
   }
   
+  listen(d_s,10);
   
   L<<Logger::Warning<<"Listening on controlsocket in '"<<fname<<"'"<<endl;
   d_nonlocal=true;
@@ -108,6 +107,7 @@
 void DynListener::listenOnTCP(const ComboAddress& local)
 {
   createSocketAndBind(AF_INET, (struct sockaddr*)& local, local.getSocklen());
+  listen(d_s,10);
   d_socketaddress=local;
   L<<Logger::Warning<<"Listening on controlsocket on 
'"<<local.toStringWithPort()<<"'"<<endl;
   d_nonlocal=true;
_______________________________________________
Pdns-users mailing list
[email protected]
http://mailman.powerdns.com/mailman/listinfo/pdns-users

Reply via email to