Thanks for your contribution. On Wed, Sep 11, 2002 at 11:55:26AM +0100, Ted_Rule@flextech.co.uk wrote:
I previously enquired whether it would be possible to allow for a keep-alive option on Unix DGRAM sockets to help avoid the situation on some platforms when daemons such as sendmail have the /dev/log socket 'whipped from under them' during syslog-ng/SIGHUP.
It also occurred to me that avoiding closing/re-opening UDP sockets on HUP should help to avoid any loss of messages across HUP on a very busy central syslog server.
I assumed - whether this is valid or not I don't know - that the current 1.5.20 source always rebuilds Unix DGRAM sockets on HUP. Likewise for UDP sockets.
Having had a look at the YACC source, I think I may have come up with a patch to help with this - it certainly appears to compile and run but it's a bit difficult to test all the possible variations on the theme, and whether it actually fulfils my original requirements.
No it doesn't. The keepalive flag is not implemented for unix-dgram sockets.
The changes involved in the patch are as follows:
Split parsing of Unix DGRAM and STREAM options apart a little more - previously it seems that the Yacc allowed for a max-connections options on a Unix DGRAM socket, even though I don't believe this is actually meaningful(?). The original source also seems to be at variance with the documentation here.
Force default keepalive setting on TCP socket. The documentation suggests this is the default, but my reading of the Yacc suggests otherwise.
Enable keepalive option on both flavours of DGRAM socket
I think it is better to use a separate option, like 'keep-socket-alive' or 'keep-listener-alive' as it might be a good idea to enable the same behaviour for stream sockets as well (e.g. not to reopen the socket)
Disable max-connections option on Unix DGRAM socket.
that's fine.
Force default keepalive setting on both flavours of DGRAM socket.
Could you enlighten me further as to whether this patch actually helps to acheive my original intent.
I'm afraid it doesn't. -- Bazsi PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1