git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Andreas Ericsson <ae@op5.se>
Date
Apr 29, 2008, 11:00 UTC
Message-ID
<4816FFEB.8050308@op5.se>
In-Reply-To
<alpine.DEB.1.00.0804291153230.27457@eeepc-johanness>
Johannes Schindelin wrote:
Show 30 quoted lines
> Hi,
> 
> On Tue, 29 Apr 2008, Andreas Ericsson wrote:
> 
>> 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
>>>> <Johannes.Schindelin@gmx.de> 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.
> 
> What can I say?  The problem just went away with my workaround.  Is it 
> possible that I have to catch SIGHUP, and closelog() && openlog()?  But 
> why do other daemons seem to not have that problem at all?
> 

Other daemons don't get SIGHUP'ed when logs are rotated. I think something else is going on there.

What syslogd are you using? Perhaps it insists on re-creating the socket. That might cause the behaviour you're seeing, but then you should probably see it in a ton of other daemons as well.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 20 of 23 in “git-daemon: fix for rotating logs”
  1. git-daemon: fix for rotating logsJohannes Schindelin, Apr 28, 2008
  2. Junio C HamanoApr 28, 2008
  3. Johannes SchindelinApr 28, 2008
  4. Miklos VajnaApr 28, 2008
  5. Mike HommeyApr 28, 2008
  6. Johannes SchindelinApr 28, 2008
  7. Miklos VajnaApr 28, 2008
  8. Johannes SchindelinApr 28, 2008
  9. Stephen R. van den BergApr 28, 2008
  10. Johannes SchindelinApr 28, 2008
  11. Stephen R. van den BergApr 28, 2008
  12. Johannes SchindelinApr 28, 2008
  13. Stephen R. van den BergApr 28, 2008
  14. Johannes SchindelinApr 28, 2008
  15. Stephen R. van den BergApr 28, 2008
  16. Johannes SchindelinApr 28, 2008
  17. Stephen R. van den BergApr 28, 2008
  18. Andreas EricssonApr 29, 2008
  19. Johannes SchindelinApr 29, 2008
  20. Andreas EricssonApr 29, 2008
  21. Johannes SchindelinApr 29, 2008
  22. Stephen R. van den BergApr 29, 2008
  23. Johannes SchindelinMay 11, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.