Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 339799 - net-misc/asterisk - logrotate postrotate script outputs "invisible" chars
Summary: net-misc/asterisk - logrotate postrotate script outputs "invisible" chars
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Tony Vroon (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-05 09:52 UTC by Jaco Kroon
Modified: 2010-10-15 17:30 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jaco Kroon 2010-10-05 09:52:13 UTC
asterisk seems to always output some characters as part of it's colorization mechanism, irrespective of whether stdin/stdout is attached to a tty or not.  When issuing asterisk -rx "logger reload" from the logrotate postrotate script this causes "[0;37m[0m" to be emailed to be every morning when logrotate runs.

This is purely due to colorization, and this can be trivially switched of by changing asterisk -rx "logger reload" to asterisk -rnx "logger reload".

At the same time I also suggest adding || /bin/true to this reload line or logrotate sometimes exhibit some weird behavior.  So basically the postrotate section should change to:

        postrotate
                /usr/sbin/asterisk -rnx "logger reload" || /bin/true
        endscript

I'm also not 100 % sure how the custom and csv modules handles their output, so I'm not convinced that a logger reload will function for /var/log/asterisk/cdr-csv/*.csv /var/log/asterisk/cdr-custom/*.csv, looking at the source for csv it looks like it does a fopen()/fwrite()/fclose() cycle for each and every entry written, and the same for cdr_custom.  So for that section the postrotate can simply be dropped.

Reproducible: Always

Steps to Reproduce:
Comment 1 Tony Vroon (RETIRED) gentoo-dev 2010-10-15 17:30:04 UTC
+*asterisk-1.6.2.13-r2 (15 Oct 2010)
+
+  15 Oct 2010; <chainsaw@gentoo.org> +asterisk-1.6.2.13-r2.ebuild,
+  +files/1.6.2/asterisk-1.6.2.13-alarm-receiver-use-playtones.patch,
+  +files/1.6.2/asterisk-1.6.2.13-confbridge-menu-invocation.patch,
+  +files/1.6.2/asterisk-1.6.2.13-pbxstart-failed-spurious-bye.patch,
+  +files/1.6.2/asterisk.logrotate3:
+  Log rotation fixes by Jaco Kroon, closes bug #339799. Scavenged fixes from
+  upstream issue reports #17368, #17524 & #18010.