- Timo Sirainen [2004-12-03 19:07]:
How can a daemon distinguish a master connection from a client connection? Clients do send CPID and master does not.
You should listen client and master connections in separate sockets and make sure that only root user can connect to master socket (ie. socket is root/root 0600).
I thought that too, but I couldn't see which socket client connect to, so I assumed it was the master's socket too. Your comment below explained the situation.
I have following auth configuration:
auth external { socket connect { master { path = /var/state/dovecot/login/master-auth
Put the master-auth socket elsewhere, eg. /var/state/dovecot/master-auth and start listening for clients in eg. /var/state/dovecot/login/client-auth (login prosesses connect to all sockets in /var/state/dovecot/login/).
Aha! I couldn't think out which socket clients do connect to. It works!
Yes.
I can't let my daemon die if the master issues DIE. Why should a server exit when it receives DIE?
It's mostly useful when Dovecot master process wants to restart dovecot-auth, you don't need to do it. Actually dovecot-auth doesn't do it either yet.
This is why I asked - I didn't see from the code what DIE is doing in the server and just wanted to know what you want it to do in the future. :-)
Thank you very much, Timo!
-- They make a desert and call it peace. -- Tacitus