ast_coredumper: Refactor to better find things

The search for a running asterisk when --running is used
has been greatly simplified and in the event it doesn't
work, you can now specify a pid to use on the command
line with --pid.

The search for asterisk modules when --tarball-coredumps
is used has been enhanced to have a better chance of finding
them and in the event it doesn't work, you can now specify
--libdir on the command line to indicate the library directory
where they were installed.

The DATEFORMAT variable was renamed to DATEOPTS and is now
passed to the 'date' utility rather than running DATEFORMAT
as a command.

The coredump and output files are now renamed with DATEOPTS.
This can be disabled by specifying --no-rename.

Several confusing and conflicting options were removed:
--append-coredumps
--conffile
--no-default-search
--tarball-uniqueid

The script was re-structured to make it easier for follow.

Change-Id: I674be64bdde3ef310b6a551d4911c3b600ffee59
This commit is contained in:
George Joseph
2021-09-09 08:39:27 -06:00
parent ae97aaedb0
commit 08cb67251f
3 changed files with 567 additions and 488 deletions

View File

@@ -0,0 +1,23 @@
Subject: ast_coredumper
New options:
--pid=<asterisk_pid>
Allows specification of an Asterisk instance when trying to
and the script can't determine it itself.
--libdir=<system library directory>
Allows specification of a non-standard installation directory
containing the Asterisk modules.
--(no-)rename
Renames the coredump and the output files with readable
timestamps. This is the default.
Removed unneeded or confusing options:
--append-coredumps
--conffile
--no-default-search
--tarball-uniqueid
Changed Variables:
COREDUMPS is now just "/tmp/core!(*.txt)"
DATEFORMAT is renamed to DATEOPTS and defaults to '-u +%FT%H-%M-%SZ'
Changed behavior:
If you use 'running' or 'RUNNING' you no longer need to specify
'--no-default-search' to ignore existing coredumps.