Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 329281 - net-misc/asterisk - logrotate file
Summary: net-misc/asterisk - logrotate file
Status: VERIFIED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Tony Vroon (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-21 14:28 UTC by Jaco Kroon
Modified: 2010-08-30 19:26 UTC (History)
1 user (show)

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


Attachments
logrotate.d/asterisk (asterisk,476 bytes, text/plain)
2010-07-21 14:29 UTC, Jaco Kroon
Details
emerge --info (emerge_info,3.56 KB, text/plain)
2010-08-30 17:13 UTC, Maxime de Roucy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jaco Kroon 2010-07-21 14:28:21 UTC
A logrotate file that can be installed into logrotate.d is useful to assist in pruning logs.

Please note that it's on purpose that I don't use sharedscripts.  Specifically the man page states this:

       sharedscripts
              Normally, prerotate and postrotate scripts are run for each log which is rotated, meaning that a single script may be run multiple times for log file entries which match multiple files (such as the /var/log/news/*  exam-
              ple).  If sharedscript is specified, the scripts are only run once, no matter how many logs match the wildcarded pattern.  However, if none of the logs in the pattern require rotating, the scripts will not be run at all.
              If the scripts exit with error, the remaining actions will not be executed for any logs. This option overrides the nosharedscripts option and implies create option.

What it neglects to add is that normally the rotation sequence is this:

* link() to new name
* unlink() old name
* run postrotate script
* run compression

When using sharedscripts the last two steps effectively swaps around, to be precise each log file is first linked to the new name, then unlinked, then compressed, and only after this has been done for all files that needs to be rotated will the postrotate script be run.  At least, this was the case last time I checked.  Two ways around this:

a)  don't use sharedscripts
b)  also use delaycompress

Reproducible: Always

Steps to Reproduce:
Comment 1 Jaco Kroon 2010-07-21 14:29:34 UTC
Created attachment 239687 [details]
logrotate.d/asterisk
Comment 2 Tony Vroon (RETIRED) gentoo-dev 2010-08-20 23:12:18 UTC
+*asterisk-1.6.2.11-r1 (20 Aug 2010)
+
+  20 Aug 2010; <chainsaw@gentoo.org> asterisk-1.2.40.ebuild,
+  asterisk-1.6.2.10.ebuild, asterisk-1.6.2.11.ebuild,
+  +asterisk-1.6.2.11-r1.ebuild,
+  +files/1.6.2/asterisk-1.6.2.11-strip-noapi.patch,
+  +files/1.6.2/asterisk.initd2, +files/1.6.2/asterisk.logrotate,
+  asterisk-1.2.37.ebuild:
+  Tweak nm call to avoid binary deletion as requested by Alexey McSakoff in
+  bug #302736. Bashims removed from init script by Kerin Millar & Federico
+  Santulli, closes bug #309277. Stock audio prompts now split out to
+  separate ebuilds and logrotate support thanks to Jaco Kroon, closes bug
+  #328513 & #329281 respectively.
Comment 3 Maxime de Roucy 2010-08-30 17:13:06 UTC
with the logrotate USE flag cron say :
error: asterisk:24 unknown option 'rotations' -- ignoring line
error: asterisk:24 unexpected text

(my emerge --info is attached)
Comment 4 Maxime de Roucy 2010-08-30 17:13:51 UTC
Created attachment 245387 [details]
emerge --info
Comment 5 Tony Vroon (RETIRED) gentoo-dev 2010-08-30 19:26:24 UTC
New issue, new bug. Do not attempt to reopen this report; it was a feature request which was actioned.