Summary:ASTERISK-07501: [patch][post 1.4] res_segfault - handle segfault with a command of choice
Reporter:Anthony Minessale (anthm)Labels:
Date Opened:2006-08-09 10:55:38Date Closed:2006-08-13 20:14:18
Versions:Frequency of
Environment:Attachments:( 0) res_segfault.c
( 1) segfault.conf.sample
Description:This module allows the user to run a command when Asterisk crashes making it possible to alert a sysop when a production system fails.


The sample config demonstrates the simple interface which is more or less:

exec => <shell command of choice>
Comments:By: Serge Vecher (serge-v) 2006-08-09 11:04:06

cool. Should this be integrated somehow with the -g option?

By: Russell Bryant (russell) 2006-08-09 15:20:58

It seems kind of silly to put this into its own module and a new configuration file.  I think the functionality is cool, but I vote for placing the code in asterisk.c and the option in asterisk.conf ...

By: damin (damin) 2006-08-09 18:13:47

I just pissed myself laughing.

By: Clod Patry (junky) 2006-08-09 20:46:22

And what about leaving this as a res and the config in asterisk.conf, maybe in a class segfault?

I personnaly like it as a module, since if you dont want it, it's not in your legs and if you want it, just load it.

By: Roy Sigurd Karlsbakk (rkarlsba) 2006-08-11 06:59:21

We should keep the text in segfault.conf.samlpe, though.
Think about all the nice messages being sent to digium support......
or perhaps not :P

Anyway, having this generate a backtrace would be fine, although it somehow seems hard......

Somehow I still find using safe_asterisk is cleaner than this, considering the what signal(2) manual is saying "According to POSIX, the behaviour of a process is undefined after it ignores a SIGFPE, SIGILL, or SIGSEGV signal that was not generated by the kill(2) or  the  raise(3) functions."


By: Russell Bryant (russell) 2006-08-13 20:14:18

Given that the behavior of a process is undefined after a SIGSEGV, I don't think this is not something we can merge.  However, the ability to email an administrator on a crash is provided using the safe_asterisk script.  I also added an EXEC option in safe_asterisk to allow the execution of whatever command you want if Asterisk crashes.