git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: Johannes Sixt <j6t@kdbg.org>
Cc: Junio C Hamano <gitster@pobox.com>,
	git@vger.kernel.org, "H. Peter Anvin" <hpa@zytor.com>
Subject: Re: [PATCH] daemon: send stderr of service programs to the syslog
Date: Mon, 15 Jun 2009 07:57:16 -0700	[thread overview]
Message-ID: <20090615145716.GW16497@spearce.org> (raw)
In-Reply-To: <200906142238.51725.j6t@kdbg.org>

Johannes Sixt <j6t@kdbg.org> wrote:
> If git-daemon is run with --detach or --inetd, then stderr is explicitly
> redirected to /dev/null. But notice that the service programs were spawned
> via execl_git_cmd(), in particular, the stderr channel is inherited from
> the daemon. This means that errors that the programs wrote to stderr (for
> example, via die()), went to /dev/null.
> 
> This patch arranges that the daemon does not merely exec the service
> program, but forks it and monitors stderr of the child; it writes the
> errors that it produces to the daemons log via logerror().
> 
> A consequence is that the daemon process remains in memory for the full
> duration of the service program, but this cannot be avoided.
> 
> Signed-off-by: Johannes Sixt <j6t@kdbg.org>
> ---
>  I don't know whether service programs like upload-archive or upload-pack
>  write progress report to stderr or not, for example, if a client does not
>  support side-bands. In this case this patch is probably not enough since
>  this would fill the log with unneeded progress information. Any hints
>  are appreciated.

They could, if they were broken.  :-)

IIRC only upload-pack produces progress (from pack-objects).
It does so by using a pipe on fd 2, and either copying it down
to the client via side-band, or discarding it.  So progress data
shouldn't ever appear on upload-pack's own fd 2, which means you
won't get it in this syslog thing.

But I have to wonder, why are we doing this?  Why can't we teach the
individual server program to record its error to the syslog before
it aborts?  Are we looking for SIGSEGV or something?  Its only the
daemon program staying around in memory, but that's a lot of little
daemons doing nothing waiting for their children to terminate.
Seems like a waste to me.
 
-- 
Shawn.

  reply	other threads:[~2009-06-15 14:57 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-14 20:38 [PATCH] daemon: send stderr of service programs to the syslog Johannes Sixt
2009-06-15 14:57 ` Shawn O. Pearce [this message]
2009-06-15 15:34   ` Nicolas Pitre
2009-06-15 19:06   ` H. Peter Anvin
2009-06-15 21:24   ` [PATCH] upload-pack: squelch progress indicator if client does not request sideband Johannes Sixt
2009-06-15 21:53     ` Junio C Hamano
2009-06-16  1:16       ` Nicolas Pitre
2009-06-16  5:02         ` Junio C Hamano
2009-06-16 18:03           ` Nicolas Pitre
2009-06-16 18:41             ` Johannes Sixt
2009-06-16 18:57               ` Junio C Hamano
2009-06-16 19:46               ` Nicolas Pitre
2009-06-15 21:39 ` [PATCH] daemon: send stderr of service programs to the syslog Johannes Sixt
2009-06-15 21:43   ` H. Peter Anvin
2009-06-16 20:27     ` Johannes Sixt
2009-06-16 20:30       ` H. Peter Anvin
2009-06-19 20:26 ` Junio C Hamano
2009-06-20 19:25   ` Johannes Sixt

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=20090615145716.GW16497@spearce.org \
    --to=spearce@spearce.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=hpa@zytor.com \
    --cc=j6t@kdbg.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).