Cillian Sharkey wrote:
> 
> [Cyrus 2.0.14-NAMESPACE-r2]
> 
> If I send master a SIGHUP (with no change to config files) I get:
> master[9653]: got SIGHUP
> master[9653]: unable to bind imap socket: Permission denied
> 
> cyrus.conf:
> SERVICES {
>   imap          cmd="imapd" listen="[127.0.0.1]:imap" prefork=0
>   imaps         cmd="imapd -s" listen="imaps" prefork=0
>   lmtpunix      cmd="lmtpd" listen="/local/cyrus/imap/socket/lmtp" prefork=0
> }
> 
> imaps service continues working, but imap service disappears. Now if I change
> config to:
> 
> SERVICES {
>   imap          cmd="imapd" listen="imap" prefork=0
>   imaps         cmd="imapd -s" listen="imaps" prefork=0
>   lmtpunix      cmd="lmtpd" listen="/local/cyrus/imap/socket/lmtp" prefork=0
> }
> 
> ..and send master a SIGHUP, I don't get any problems. So it appears as if the
> problem exists when a specific IP addr is gven to bind to but no problem with
> INADDR_ANY. I don't recall this happening in 2.0.12 when I had a similar
> setup.


I found the problem and checked in the attached patch.

The basic problem was that the code that Amos Gouaux wrote for parsing
the 'listen' parameter into host and post, does so destructively and
leaves just the host part in the original 'listen' variable (no fault of
his, I should have looked closer).  The result was that a SIGHUP in your
first example was comparing '127.0.0.1' and '[127.0.0.1]:imap' to see if
the service listen parameter changed -- which caused the service to be
reconfigured each time.

Another problem was that I was leaving removed/changed services in the
linked list, which caused services to be needlessly reconfigured.

I've tested this fix locally, but I'm interested in any feedback.

Ken
-- 
Kenneth Murchison     Oceana Matrix Ltd.
Software Engineer     21 Princeton Place
716-662-8973 x26      Orchard Park, NY 14127
--PGP Public Key--    http://www.oceana.com/~ken/ksm.pgp

master.patch.gz

Reply via email to