Subject: Re: [PATCH] git-daemon: fix for rotating logs

From: Andreas Ericsson <[email-masked]>
Date: Tue, 29 Apr 2008 08:17:27 +0200

Mike Hommey wrote:
> On Mon, Apr 28, 2008 at 08:21:14PM +0200, Miklos Vajna wrote:
>> On Mon, Apr 28, 2008 at 07:08:50PM +0100, Johannes Schindelin <[email-masked]> wrote:
>>>>> With rotating logs, there is a problem when the syslog is opened only 
>>>>> once (in the beginning).  So open the log everytime we write 
>>>>> something, and close it directly after writing.
>>>> Gaah, this is ugly.
>>>>
>>>> Is this something all the daemons need to deal with?
>>> I have no idea, but it seems to fix a real issue.
>> logrotate supports sending a signal (typically SIGHUP) to the process
>> after it rotated the log. Couldn't we just re-open the log on SIGHUP?
> 
> Isn't the problem that git-daemon loses its connection to the syslog
> daemon when logrotate sighups syslog?
> 

It really shouldn't. The connection to the syslog daemon is just a
unix socket (/dev/log) which is used to send whatever passes for
UDP packets on unix domain sockets. Since the socket isn't re-created
by syslogd (well, a sane syslogd anyways), but rather just open()'ed
for reading, no program should ever need to reconnect.

-- 
Andreas Ericsson                   [email-masked]
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231