From mboxrd@z Thu Jan 1 00:00:00 1970 From: Johannes Schindelin Subject: Re: [PATCH] git-daemon: fix for rotating logs Date: Tue, 29 Apr 2008 11:54:27 +0100 (BST) Message-ID: References: <7vtzhmaqpd.fsf@gitster.siamese.dyndns.org> <20080428182114.GF26880@genesis.frugalware.org> <20080428182917.GA4794@glandium.org> <4816BD77.1060709@op5.se> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: Mike Hommey , Junio C Hamano , git@vger.kernel.org To: Andreas Ericsson X-From: git-owner@vger.kernel.org Tue Apr 29 12:55:04 2008 connect(): Connection refused Return-path: Envelope-to: gcvg-git-2@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by lo.gmane.org with esmtp (Exim 4.50) id 1JqnUF-0006Ze-BE for gcvg-git-2@gmane.org; Tue, 29 Apr 2008 12:55:03 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754538AbYD2KyQ (ORCPT ); Tue, 29 Apr 2008 06:54:16 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754533AbYD2KyQ (ORCPT ); Tue, 29 Apr 2008 06:54:16 -0400 Received: from mail.gmx.net ([213.165.64.20]:43967 "HELO mail.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1754119AbYD2KyP (ORCPT ); Tue, 29 Apr 2008 06:54:15 -0400 Received: (qmail invoked by alias); 29 Apr 2008 10:54:14 -0000 Received: from cbg-off-client.mpi-cbg.de (EHLO eeepc-johanness.mpi-cbg.de) [141.5.11.5] by mail.gmx.net (mp025) with SMTP; 29 Apr 2008 12:54:14 +0200 X-Authenticated: #1490710 X-Provags-ID: V01U2FsdGVkX18L2sJ8rSILsv6C6a9dVbe0RmgZ3Vf6rbilwNxWzf mpdf9SjaAgB0za X-X-Sender: user@eeepc-johanness In-Reply-To: <4816BD77.1060709@op5.se> User-Agent: Alpine 1.00 (DEB 882 2007-12-20) X-Y-GMX-Trusted: 0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: 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 > > > 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? Ciao, Dscho