mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* logging when SIGSEGV is processed?
@ 2003-09-14  1:28 Folkert van Heusden
  2003-09-14  2:18 ` Joshua Kwan
  0 siblings, 1 reply; 8+ messages in thread
From: Folkert van Heusden @ 2003-09-14  1:28 UTC (permalink / raw)
  To: linux-kernel

Hi,

I found this patch for kernel 2.2 which logs a message when some process 
receives SIGSEGV. Imho something very usefull: I could create some script 
which sends an e-mail if some critical (apache, mysql, etc.) process 
segfaults. I was wondering: has anyone ported this patch to 2.4 or 2.6? 


Folkert van Heusden

+--------------------------------------------------------------------------+
| UNIX sysop? Then give MultiTail ( http://www.vanheusden.com/multitail/ ) |
| a try, it brings monitoring logfiles (and such) to a different level!    |
+---------------------------------------------------= www.vanheusden.com =-+


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

* Re: logging when SIGSEGV is processed?
  2003-09-14  1:28 logging when SIGSEGV is processed? Folkert van Heusden
@ 2003-09-14  2:18 ` Joshua Kwan
  2003-09-14  7:23   ` Folkert van Heusden
  0 siblings, 1 reply; 8+ messages in thread
From: Joshua Kwan @ 2003-09-14  2:18 UTC (permalink / raw)
  To: linux-kernel; +Cc: folkert

[-- Attachment #1: Type: text/plain, Size: 409 bytes --]

On Sun, Sep 14, 2003 at 03:28:54AM +0200, Folkert van Heusden wrote:
> I found this patch for kernel 2.2 which logs a message when some process 
> receives SIGSEGV. Imho something very usefull: I could create some script 
> which sends an e-mail if some critical (apache, mysql, etc.) process 
> segfaults. I was wondering: has anyone ported this patch to 2.4 or 2.6? 

What patch?

-- 
Joshua Kwan

[-- Attachment #2: Type: application/pgp-signature, Size: 827 bytes --]

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

* Re: logging when SIGSEGV is processed?
  2003-09-14  2:18 ` Joshua Kwan
@ 2003-09-14  7:23   ` Folkert van Heusden
  0 siblings, 0 replies; 8+ messages in thread
From: Folkert van Heusden @ 2003-09-14  7:23 UTC (permalink / raw)
  To: Joshua Kwan, linux-kernel

On Sunday 14 September 2003 04:18, Joshua Kwan wrote:
> On Sun, Sep 14, 2003 at 03:28:54AM +0200, Folkert van Heusden wrote:
> > I found this patch for kernel 2.2 which logs a message when some process
> > receives SIGSEGV. Imho something very usefull: I could create some script
> > which sends an e-mail if some critical (apache, mysql, etc.) process
> > segfaults. I was wondering: has anyone ported this patch to 2.4 or 2.6?
>
> What patch?

http://www.kyuzz.org/antirez/sigsegv/


Folkert van Heusden

+--------------------------------------------------------------------------+
| UNIX sysop? Then give MultiTail ( http://www.vanheusden.com/multitail/ ) |
| a try, it brings monitoring logfiles (and such) to a different level!    |
+---------------------------------------------------= www.vanheusden.com =-+


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

* Re: logging when SIGSEGV is processed?
  2003-09-15  7:47     ` Alan Cox
@ 2003-09-15 16:05       ` Folkert van Heusden
  0 siblings, 0 replies; 8+ messages in thread
From: Folkert van Heusden @ 2003-09-15 16:05 UTC (permalink / raw)
  To: Alan Cox, alexander.riesen
  Cc: bert hubert, Mo McKinlay, Linux Kernel Mailing List

> On Llu, 2003-09-15 at 08:09, Alex Riesen wrote:
> > Probably ptrace the daemon (following all its children) would server
> > better. The feature (logging the coredumps) is definitely no needed for
> > everything, just some suspectables.
> accton() will turn on logging and that gives you log records of process
> termination including if it segfaulted.

Sound's good. You probably mean acct()? There's one little problem with that 
one:
NOTES
       No accounting is produced  for  programs  running  when  a
       crash occurs.  In particular, nonterminating processes are
       never accounted for.


Folkert van Heusden

+--------------------------------------------------------------------------+
| UNIX sysop? Then give MultiTail ( http://www.vanheusden.com/multitail/ ) |
| a try, it brings monitoring logfiles (and such) to a different level!    |
+---------------------------------------------------= www.vanheusden.com =-+


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

* Re: logging when SIGSEGV is processed?
  2003-09-15  7:09   ` Alex Riesen
@ 2003-09-15  7:47     ` Alan Cox
  2003-09-15 16:05       ` Folkert van Heusden
  0 siblings, 1 reply; 8+ messages in thread
From: Alan Cox @ 2003-09-15  7:47 UTC (permalink / raw)
  To: alexander.riesen; +Cc: bert hubert, Mo McKinlay, Linux Kernel Mailing List

On Llu, 2003-09-15 at 08:09, Alex Riesen wrote:
> Probably ptrace the daemon (following all its children) would server better.
> The feature (logging the coredumps) is definitely no needed for
> everything, just some suspectables.

accton() will turn on logging and that gives you log records of process
termination including if it segfaulted.


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

* Re: logging when SIGSEGV is processed?
  2003-09-14 17:17 ` bert hubert
@ 2003-09-15  7:09   ` Alex Riesen
  2003-09-15  7:47     ` Alan Cox
  0 siblings, 1 reply; 8+ messages in thread
From: Alex Riesen @ 2003-09-15  7:09 UTC (permalink / raw)
  To: bert hubert, Mo McKinlay, linux-kernel

bert hubert, Sun, Sep 14, 2003 19:17:41 +0200:
> On Sun, Sep 14, 2003 at 12:14:08PM +0100, Mo McKinlay wrote:
> 
> > Admittedly, it might need some shoehorning into some existing setups (i.e.,
> > where the daemon you wish to watch isn't started directly, but by something
> > else), but it wouldn't be too tricky, I'd've thought.
> 
> init receives that stuff if a process has no other parent, I think, so that
> might be a great place.
> 

will not work if the signal received by the child of a daemon, which does
nothing about its status.

Probably ptrace the daemon (following all its children) would server better.
The feature (logging the coredumps) is definitely no needed for
everything, just some suspectables.


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

* Re: logging when SIGSEGV is processed?
  2003-09-14 11:14 Mo McKinlay
@ 2003-09-14 17:17 ` bert hubert
  2003-09-15  7:09   ` Alex Riesen
  0 siblings, 1 reply; 8+ messages in thread
From: bert hubert @ 2003-09-14 17:17 UTC (permalink / raw)
  To: Mo McKinlay; +Cc: linux-kernel

On Sun, Sep 14, 2003 at 12:14:08PM +0100, Mo McKinlay wrote:

> Admittedly, it might need some shoehorning into some existing setups (i.e.,
> where the daemon you wish to watch isn't started directly, but by something
> else), but it wouldn't be too tricky, I'd've thought.

init receives that stuff if a process has no other parent, I think, so that
might be a great place.

-- 
http://www.PowerDNS.com      Open source, database driven DNS Software 
http://lartc.org           Linux Advanced Routing & Traffic Control HOWTO

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

* Re: logging when SIGSEGV is processed?
@ 2003-09-14 11:14 Mo McKinlay
  2003-09-14 17:17 ` bert hubert
  0 siblings, 1 reply; 8+ messages in thread
From: Mo McKinlay @ 2003-09-14 11:14 UTC (permalink / raw)
  To: linux-kernel

> I found this patch for kernel 2.2 which logs a message when some process 
> receives SIGSEGV.

Why not just do it in userspace? A program which does nothing more than
spawn a child and wait for it to terminate, performing some action based on
the kind and status of exit, should be fairly trivial?

Admittedly, it might need some shoehorning into some existing setups (i.e.,
where the daemon you wish to watch isn't started directly, but by something
else), but it wouldn't be too tricky, I'd've thought.

[See wait(2), specifically the bits about how to interpret `status']

Mo.

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

end of thread, other threads:[~2003-09-15 16:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-14  1:28 logging when SIGSEGV is processed? Folkert van Heusden
2003-09-14  2:18 ` Joshua Kwan
2003-09-14  7:23   ` Folkert van Heusden
2003-09-14 11:14 Mo McKinlay
2003-09-14 17:17 ` bert hubert
2003-09-15  7:09   ` Alex Riesen
2003-09-15  7:47     ` Alan Cox
2003-09-15 16:05       ` Folkert van Heusden

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®