mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Michael Kerrisk" <mtk.manpages@googlemail.com>
To: "Neil Horman" <nhorman@tuxdriver.com>
Cc: "Andi Kleen" <andi@firstfloor.org>,
	linux-man@vger.kernel.org,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Petr Gajdos" <pgajdos@suse.cz>,
	michael.kerrisk@gmail.com
Subject: Re: core_pattern pipe documentation
Date: Fri, 25 Apr 2008 15:18:46 +0200	[thread overview]
Message-ID: <cfd18e0f0804250618ic6dfd09gf68573256be3ff@mail.gmail.com> (raw)
In-Reply-To: <20080423145933.GA26228@hmsendeavour.rdu.redhat.com>

Hi Neil,

On Wed, Apr 23, 2008 at 4:59 PM, Neil Horman <nhorman@tuxdriver.com> wrote:
>
> On Wed, Apr 23, 2008 at 02:09:14PM +0200, Michael Kerrisk wrote:
> > Andi -- ping!
> >
> > Adding Neil to CC, since it looks like he also did some work here, and
> > so can perhaps comment.
> >
> > On Fri, Apr 18, 2008 at 6:53 PM, Michael Kerrisk
> > <mtk.manpages@googlemail.com> wrote:
> > > Andi,
> > >
> > > I wrote the following description of the core_pattern pipe feature.  Does this
> > > seem okay?
> > >
> > >   Piping core dumps to a program
> > >       Since kernel 2.6.19, Linux supports an  alternate  syntax
> > >       for the /proc/sys/kernel/core_pattern file.  If the first
> > >       character of this file is a pipe  symbol  (|),  then  the
> > >       remainder  of  the line is interpreted as a program to be
> > >       executed.  Instead of being written to a disk  file,  the
> > >       core  dump  is  given  as  standard input to the program.
> > >       Note the following points:
> > >
> > >       *  The program must be specified using an absolute  path-
> > >          name  (or  a  pathname relative to the root directory,
> > >          /), and must immediately follow the '|' character.
> > >
> > >       *  The process created to run the program  runs  as  user
> > >          and group root.
> > >
> > >       *  Arguments can be supplied to the program, delimited by
> > >          white space (up to a total line length of 128  bytes).
> > >
> > > Cheers,
> > >
> > > Michael
> > >
> Thanks for CC'ing me.  The above all looks good.  I would add documentation
> however, about the available macros that can be used when core_pattern is
> specified as a pipe.  Adding something like the following would be good:
>
>        * Arguments can be statically declared or implied via the use of macros,
>          denoted by the use of the %sign.  The following macros are supported:
>                * %% - output a literal % sign on the command line
>                * %p - the pid of the crashing process
>                * %u - the uid of the crashing process
>                * %g - the gid of the crashing process
>                * %s - the signal that caused the crashing process to crash
>                * %t - the time the crashing process dumped
>                * %h - the hostname of the system
>                * %e - the executable name of the crashing process
>                * %c - the core limit size of the crashing process

Thanks for pointing that out!  I'll note it in the page.

>          Note that the core limit size macro may be a different value than what
>          is returned by getrlimit(RLIMIT_CORE,...).  This is due to the fact
>          that the core_pattern specified executible will be run as the same uid
>          as the crashing process, and to facilitate reception of the entire
>          core, the kernel will temporarily set RLIMIT_CORE to unlimited while
>          the dump is in progress.

Actually, I can't seem to get an example of this behavior.  In my
experiments, %c always seems to give the "right" info (i.e., I don't
ever see %c showing 2^32 (unlimited) when I set a soft limit).  Can
you show a specific case where it doesn't give the "right" value?

>          Note also %u and %g may be different values
>          than getuid/getgid in the event that the core_pattern executable is
>          set[u|g]id root

I'm slightly confused by that last point.  According to my
experiments, the core_pattern executable is always run as user and
group root, so making it set[ug]id root would seem to be a no-op.
(But anyway, %u and %g do give the "right" values -- the UID and GID
of the dumping process.)

Cheers,

Michael


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Found a bug? http://www.kernel.org/doc/man-pages/reporting_bugs.html

  reply	other threads:[~2008-04-25 13:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-15 21:09 core_pattern piping strangeness Michael Kerrisk
     [not found] ` <cfd18e0f0804151411x62080f10y833493db7f1b8cfd@mail.gmail.com>
     [not found]   ` <48051FBA.60503@firstfloor.org>
2008-04-18 16:53     ` core_pattern pipe documentation Michael Kerrisk
2008-04-23 12:09       ` Michael Kerrisk
2008-04-23 14:59         ` Neil Horman
2008-04-25 13:18           ` Michael Kerrisk [this message]
2008-04-25 16:22             ` Neil Horman
2008-04-25 18:13               ` Michael Kerrisk
2008-04-25 18:54                 ` Neil Horman
2008-04-25 19:50                   ` Michael Kerrisk
2008-04-25 20:05                   ` Michael Kerrisk
2008-04-25 20:18                     ` Neil Horman
2008-04-25 20:39                       ` Michael Kerrisk
2008-05-05  7:19                         ` core_pattern pipe documentation - draft 2 Michael Kerrisk
2008-05-05 11:29                           ` Neil Horman

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=cfd18e0f0804250618ic6dfd09gf68573256be3ff@mail.gmail.com \
    --to=mtk.manpages@googlemail.com \
    --cc=andi@firstfloor.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-man@vger.kernel.org \
    --cc=michael.kerrisk@gmail.com \
    --cc=nhorman@tuxdriver.com \
    --cc=pgajdos@suse.cz \
    /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

Powered by JetHome