All of lore.kernel.org
 help / color / mirror / Atom feed
* core sysctl
@ 2020-05-25 15:08 Jonny Grant
  2020-05-27 13:06 ` Michael Kerrisk (man-pages)
  0 siblings, 1 reply; 9+ messages in thread
From: Jonny Grant @ 2020-05-25 15:08 UTC (permalink / raw)
  To: Michael Kerrisk, linux-man

Suggestion for some additional information on this page:

http://man7.org/linux/man-pages/man5/core.5.html

Could "Core dumps and systemd" be extended to give an example of sysctl making a temporary change?

eg set to the filename and signal that causes the core dump:

# sysctl -w kernel.core_pattern="%e-%s.core"


Cheers, Jonny

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: core sysctl
  2020-05-25 15:08 core sysctl Jonny Grant
@ 2020-05-27 13:06 ` Michael Kerrisk (man-pages)
  2020-05-27 13:23   ` Jonny Grant
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Kerrisk (man-pages) @ 2020-05-27 13:06 UTC (permalink / raw)
  To: Jonny Grant; +Cc: linux-man

Hi Jonny,

On Mon, 25 May 2020 at 17:08, Jonny Grant <jg@jguk.org> wrote:
>
> Suggestion for some additional information on this page:
>
> http://man7.org/linux/man-pages/man5/core.5.html
>
> Could "Core dumps and systemd" be extended to give an
> example of sysctl making a temporary change?
>
> eg set to the filename and signal that causes the core dump:
>
> # sysctl -w kernel.core_pattern="%e-%s.core"

I'm a little confused: what do you mean by "making a *temporary*
change" (i.e., where does "temporary" come into it)?

Thanks,

Michael

-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: core sysctl
  2020-05-27 13:06 ` Michael Kerrisk (man-pages)
@ 2020-05-27 13:23   ` Jonny Grant
  2020-05-27 13:32     ` Michael Kerrisk (man-pages)
  0 siblings, 1 reply; 9+ messages in thread
From: Jonny Grant @ 2020-05-27 13:23 UTC (permalink / raw)
  To: mtk.manpages; +Cc: linux-man



On 27/05/2020 14:06, Michael Kerrisk (man-pages) wrote:
> Hi Jonny,
> 
> On Mon, 25 May 2020 at 17:08, Jonny Grant <jg@jguk.org> wrote:
>>
>> Suggestion for some additional information on this page:
>>
>> http://man7.org/linux/man-pages/man5/core.5.html
>>
>> Could "Core dumps and systemd" be extended to give an
>> example of sysctl making a temporary change?
>>
>> eg set to the filename and signal that causes the core dump:
>>
>> # sysctl -w kernel.core_pattern="%e-%s.core"
> 
> I'm a little confused: what do you mean by "making a *temporary*
> change" (i.e., where does "temporary" come into it)?
> 
> Thanks,
> 
> Michael
> 

As I understood, this core pattern is set until reboot. For a permanent change, I set in this file:
/etc/sysctl.d/99-sysctl.conf

Cheers, Jonny

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: core sysctl
  2020-05-27 13:23   ` Jonny Grant
@ 2020-05-27 13:32     ` Michael Kerrisk (man-pages)
  2020-05-27 15:22       ` Jonny Grant
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Kerrisk (man-pages) @ 2020-05-27 13:32 UTC (permalink / raw)
  To: Jonny Grant; +Cc: linux-man

Hi Jonny

On Wed, 27 May 2020 at 15:23, Jonny Grant <jg@jguk.org> wrote:
>
>
>
> On 27/05/2020 14:06, Michael Kerrisk (man-pages) wrote:
> > Hi Jonny,
> >
> > On Mon, 25 May 2020 at 17:08, Jonny Grant <jg@jguk.org> wrote:
> >>
> >> Suggestion for some additional information on this page:
> >>
> >> http://man7.org/linux/man-pages/man5/core.5.html
> >>
> >> Could "Core dumps and systemd" be extended to give an
> >> example of sysctl making a temporary change?
> >>
> >> eg set to the filename and signal that causes the core dump:
> >>
> >> # sysctl -w kernel.core_pattern="%e-%s.core"
> >
> > I'm a little confused: what do you mean by "making a *temporary*
> > change" (i.e., where does "temporary" come into it)?
> >
> > Thanks,
> >
> > Michael
> >
>
> As I understood, this core pattern is set until reboot.

Okay, now I understand. Next question: what's the value in having the
signal number in the filename?

Thanks,

Michael



-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: core sysctl
  2020-05-27 13:32     ` Michael Kerrisk (man-pages)
@ 2020-05-27 15:22       ` Jonny Grant
  2020-05-28  9:16         ` Michael Kerrisk (man-pages)
  0 siblings, 1 reply; 9+ messages in thread
From: Jonny Grant @ 2020-05-27 15:22 UTC (permalink / raw)
  To: mtk.manpages; +Cc: linux-man



On 27/05/2020 14:32, Michael Kerrisk (man-pages) wrote:
> Hi Jonny
> 
> On Wed, 27 May 2020 at 15:23, Jonny Grant <jg@jguk.org> wrote:
>>
>>
>>
>> On 27/05/2020 14:06, Michael Kerrisk (man-pages) wrote:
>>> Hi Jonny,
>>>
>>> On Mon, 25 May 2020 at 17:08, Jonny Grant <jg@jguk.org> wrote:
>>>>
>>>> Suggestion for some additional information on this page:
>>>>
>>>> http://man7.org/linux/man-pages/man5/core.5.html
>>>>
>>>> Could "Core dumps and systemd" be extended to give an
>>>> example of sysctl making a temporary change?
>>>>
>>>> eg set to the filename and signal that causes the core dump:
>>>>
>>>> # sysctl -w kernel.core_pattern="%e-%s.core"
>>>
>>> I'm a little confused: what do you mean by "making a *temporary*
>>> change" (i.e., where does "temporary" come into it)?
>>>
>>> Thanks,
>>>
>>> Michael
>>>
>>
>> As I understood, this core pattern is set until reboot.
> 
> Okay, now I understand. Next question: what's the value in having the
> signal number in the filename?

The signal number indicates the reason the core was dumped, eg 11 SIGSEGV,  SIGTRAP is 5.

%P %t %I also useful.
Cheers, Jonny

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: core sysctl
  2020-05-27 15:22       ` Jonny Grant
@ 2020-05-28  9:16         ` Michael Kerrisk (man-pages)
  2020-05-28  9:28           ` Jakub Wilk
  2020-05-28  9:51           ` Jonny Grant
  0 siblings, 2 replies; 9+ messages in thread
From: Michael Kerrisk (man-pages) @ 2020-05-28  9:16 UTC (permalink / raw)
  To: Jonny Grant; +Cc: mtk.manpages, linux-man

Hello Jonny,

On 5/27/20 5:22 PM, Jonny Grant wrote:
> 
> 
> On 27/05/2020 14:32, Michael Kerrisk (man-pages) wrote:
>> Hi Jonny
>>
>> On Wed, 27 May 2020 at 15:23, Jonny Grant <jg@jguk.org> wrote:
>>>
>>>
>>>
>>> On 27/05/2020 14:06, Michael Kerrisk (man-pages) wrote:
>>>> Hi Jonny,
>>>>
>>>> On Mon, 25 May 2020 at 17:08, Jonny Grant <jg@jguk.org> wrote:
>>>>>
>>>>> Suggestion for some additional information on this page:
>>>>>
>>>>> http://man7.org/linux/man-pages/man5/core.5.html
>>>>>
>>>>> Could "Core dumps and systemd" be extended to give an
>>>>> example of sysctl making a temporary change?
>>>>>
>>>>> eg set to the filename and signal that causes the core dump:
>>>>>
>>>>> # sysctl -w kernel.core_pattern="%e-%s.core"
>>>>
>>>> I'm a little confused: what do you mean by "making a *temporary*
>>>> change" (i.e., where does "temporary" come into it)?
>>>>
>>>> Thanks,
>>>>
>>>> Michael
>>>>
>>>
>>> As I understood, this core pattern is set until reboot.
>>
>> Okay, now I understand. Next question: what's the value in having the
>> signal number in the filename?
> 
> The signal number indicates the reason the core was dumped, > eg 11 SIGSEGV,  SIGTRAP is 5.

Sure, it tells us what signal triggered the core dump.
My reason for the question was that it doesn't tell us the
*reason* for the core dump--for example, SIGSEGV can be
generated for many reasons.

> %P %t %I also useful.

Okay. I applied the patch below.

Thanks,

Michael


diff --git a/man5/core.5 b/man5/core.5
index 9725ff64a..6dbaa69b8 100644
--- a/man5/core.5
+++ b/man5/core.5
@@ -533,7 +533,7 @@ For more extensive details, see the
 .BR coredumpctl (1)
 manual page.
 .PP
-To disable the
+To (persistently) disable the
 .BR systemd (1)
 mechanism that archives core dumps, restoring to something more like
 traditional Linux behavior, one can set an override for the
@@ -548,6 +548,18 @@ mechanism, using something like:
 .EE
 .in
 .PP
+It is also possible to temporarily (i.e., until the next reboot) change the
+.I core_patter
+setting using a command such as the following
+(which causes the names of core dump files to include the executable name
+as well as the number of the signal which triggered the core dump):
+.PP
+.in +4n
+.EX
+# \fBsysctl \-w kernel.core_pattern="%e\-%s.core"\fP
+.EE
+.in
+.PP
 .\"
 .SH NOTES
 The


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: core sysctl
  2020-05-28  9:16         ` Michael Kerrisk (man-pages)
@ 2020-05-28  9:28           ` Jakub Wilk
  2020-05-28  9:38             ` Michael Kerrisk (man-pages)
  2020-05-28  9:51           ` Jonny Grant
  1 sibling, 1 reply; 9+ messages in thread
From: Jakub Wilk @ 2020-05-28  9:28 UTC (permalink / raw)
  To: Michael Kerrisk; +Cc: Jonny Grant, linux-man

* Michael Kerrisk <mtk.manpages@gmail.com>, 2020-05-28, 11:16:
>+.I core_patter

Trailing "n" is missing.

-- 
Jakub Wilk

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: core sysctl
  2020-05-28  9:28           ` Jakub Wilk
@ 2020-05-28  9:38             ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 9+ messages in thread
From: Michael Kerrisk (man-pages) @ 2020-05-28  9:38 UTC (permalink / raw)
  To: Jakub Wilk; +Cc: mtk.manpages, Jonny Grant, linux-man

On 5/28/20 11:28 AM, Jakub Wilk wrote:
> * Michael Kerrisk <mtk.manpages@gmail.com>, 2020-05-28, 11:16:
>> +.I core_patter
> 
> Trailing "n" is missing.

Thanks, Jakub.


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: core sysctl
  2020-05-28  9:16         ` Michael Kerrisk (man-pages)
  2020-05-28  9:28           ` Jakub Wilk
@ 2020-05-28  9:51           ` Jonny Grant
  1 sibling, 0 replies; 9+ messages in thread
From: Jonny Grant @ 2020-05-28  9:51 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages); +Cc: linux-man



On 28/05/2020 10:16, Michael Kerrisk (man-pages) wrote:
> Hello Jonny,
> 
> On 5/27/20 5:22 PM, Jonny Grant wrote:
>>
>>
>> On 27/05/2020 14:32, Michael Kerrisk (man-pages) wrote:
>>> Hi Jonny
>>>
>>> On Wed, 27 May 2020 at 15:23, Jonny Grant <jg@jguk.org> wrote:
>>>>
>>>>
>>>>
>>>> On 27/05/2020 14:06, Michael Kerrisk (man-pages) wrote:
>>>>> Hi Jonny,
>>>>>
>>>>> On Mon, 25 May 2020 at 17:08, Jonny Grant <jg@jguk.org> wrote:
>>>>>>
>>>>>> Suggestion for some additional information on this page:
>>>>>>
>>>>>> http://man7.org/linux/man-pages/man5/core.5.html
>>>>>>
>>>>>> Could "Core dumps and systemd" be extended to give an
>>>>>> example of sysctl making a temporary change?
>>>>>>
>>>>>> eg set to the filename and signal that causes the core dump:
>>>>>>
>>>>>> # sysctl -w kernel.core_pattern="%e-%s.core"
>>>>>
>>>>> I'm a little confused: what do you mean by "making a *temporary*
>>>>> change" (i.e., where does "temporary" come into it)?
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Michael
>>>>>
>>>>
>>>> As I understood, this core pattern is set until reboot.
>>>
>>> Okay, now I understand. Next question: what's the value in having the
>>> signal number in the filename?
>>
>> The signal number indicates the reason the core was dumped, > eg 11 SIGSEGV,  SIGTRAP is 5.
> 
> Sure, it tells us what signal triggered the core dump.
> My reason for the question was that it doesn't tell us the
> *reason* for the core dump--for example, SIGSEGV can be
> generated for many reasons.

Yes you're right. I'm sure you know all this already, there are a few crash handlers that uses gdb to generate a 
backtrace automatically.

Thank you for adding the change
Jonny

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-05-28  9:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-25 15:08 core sysctl Jonny Grant
2020-05-27 13:06 ` Michael Kerrisk (man-pages)
2020-05-27 13:23   ` Jonny Grant
2020-05-27 13:32     ` Michael Kerrisk (man-pages)
2020-05-27 15:22       ` Jonny Grant
2020-05-28  9:16         ` Michael Kerrisk (man-pages)
2020-05-28  9:28           ` Jakub Wilk
2020-05-28  9:38             ` Michael Kerrisk (man-pages)
2020-05-28  9:51           ` Jonny Grant

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.