git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Ericsson <ae@op5.se>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Mike Hommey <mh@glandium.org>, Junio C Hamano <gitster@pobox.com>,
	git@vger.kernel.org
Subject: Re: [PATCH] git-daemon: fix for rotating logs
Date: Tue, 29 Apr 2008 13:00:59 +0200	[thread overview]
Message-ID: <4816FFEB.8050308@op5.se> (raw)
In-Reply-To: <alpine.DEB.1.00.0804291153230.27457@eeepc-johanness>

Johannes Schindelin wrote:
> 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

  reply	other threads:[~2008-04-29 11:02 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-28 14:24 [PATCH] git-daemon: fix for rotating logs Johannes Schindelin
2008-04-28 16:29 ` Junio C Hamano
2008-04-28 18:08   ` Johannes Schindelin
2008-04-28 18:21     ` Miklos Vajna
2008-04-28 18:29       ` Mike Hommey
2008-04-28 18:37         ` Johannes Schindelin
2008-04-28 19:00           ` Miklos Vajna
2008-04-28 19:24             ` Johannes Schindelin
2008-04-28 19:28             ` Stephen R. van den Berg
2008-04-28 19:53               ` Johannes Schindelin
2008-04-28 20:43                 ` Stephen R. van den Berg
2008-04-28 20:53                   ` Johannes Schindelin
2008-04-28 21:00                     ` Stephen R. van den Berg
2008-04-28 21:09                       ` Johannes Schindelin
2008-04-28 21:13                         ` Stephen R. van den Berg
2008-04-28 21:23                           ` Johannes Schindelin
2008-04-28 23:16                             ` Stephen R. van den Berg
2008-04-29  6:17         ` Andreas Ericsson
2008-04-29 10:54           ` Johannes Schindelin
2008-04-29 11:00             ` Andreas Ericsson [this message]
2008-04-29 15:16               ` Johannes Schindelin
2008-04-29 17:58                 ` Stephen R. van den Berg
2008-05-11 18:03 ` Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4816FFEB.8050308@op5.se \
    --to=ae@op5.se \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=mh@glandium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).