809e836265
In order to get a dump of the running process, we need to find the pid of the main asterisk process. This can be tricky if there are also instances of "asterisk -r" running or if an alternate location for asterisk.conf was specified on the command line with the -C option that also specified an alternation location for the pid file. So now... 1. We find the asterisk executable with "which" or the --asterisk-bin command line option. 2. If there's only 1 process with an executable path that matches, we use that pid. If not... 3. We try "<asterisk-bin> -rx 'core show settings'" and parse the output to find the pidfile, then read that for the pid. If that didn't work... 4. We get a list of all the pids matching <asterisk-bin> and look in /proc/<pid>/cmdline for a -C argument and retry the "core show settings" using the same -C option. We can't parse the output of "ps" to get the -C path because it may contain spaces. The contents of /proc/<pid>/cmdline are delimited by NULLs. For BSDs we may have to mount /proc first. :( ASTERISK-28221 Reported by: Andrew Nagy Change-Id: I8aa1f3f912f949df2b5348908803c636bde1d57c |
||
---|---|---|
.. | ||
sip_to_pjsip | ||
agents.php | ||
ast_coredumper | ||
ast_grab_core | ||
ast_logescalator | ||
ast_loggrabber | ||
ast_tls_cert | ||
astcli | ||
asterisk.ldap-schema | ||
asterisk.ldif | ||
asterisk.logrotate | ||
astgenkey | ||
astgenkey.8 | ||
astversion | ||
autosupport | ||
autosupport.8 | ||
clang-scan-build | ||
dahdi_span_config_hook | ||
dbsep.cgi | ||
file.convert.sh | ||
get_ilbc_source.sh | ||
get_mp3_source.sh | ||
get_swagger_ui.sh | ||
import-cdr-csv-mysql.pl | ||
install_prereq | ||
live_ast | ||
loadtest.tcl | ||
lookup.agi | ||
managerproxy.pl | ||
messages-expire.pl | ||
qview.pl | ||
README.messages-expire | ||
refcounter.py | ||
reflocks.py | ||
refstats.py | ||
retrieve_extensions_from_mysql.pl | ||
retrieve_extensions_from_sql.pl | ||
retrieve_sip_conf_from_mysql.pl | ||
safe_asterisk | ||
safe_asterisk.8 | ||
safe_asterisk_restart | ||
sip_nat_settings | ||
sipp-sendfax.xml | ||
spandspflow2pcap.log | ||
spandspflow2pcap.py | ||
valgrind_compare | ||
vmail.cgi | ||
voicemailpwcheck.py |
messages-expire.pl messages-expire finds messages more than X days old and deletes them. Because the older messages will be the lower numbers in the folder (msg0000 will be older than msg0005), just deleting msg0000 will not work. expire-messages then runs a routine that goes into every folder in every mailbox to reorganize. If the folder contains msg0000, no action is taken. If the folder does not, the rename routine takes the oldest message and names it msg0000, the next oldest message and names it msg0001 and so on. The file deletion is done by the -exec parameter to 'find'. It would be far more efficient to take the output from 'find' and just reorganize the directories from which we deleted a file. Something for the future... Keep in mind that messages are deleted at the beginning of the script you will have mailbox trouble if you check messages before the script reorganizes your mailbox. To use it, make sure the paths are right. Adjust $age (originally set to 31) if necessary.