Hi, Last year, I installed Asterisk 10.4.2 and enabled logrotate on daily basis which was working perfect. Now in couple of months back, the logrotate feature is not working at all but simply appending the logs in 'messages' file. Listing down down the configuration for logrotate below; /var/log/asterisk/messages { missingok rotate 5 daily postrotate /usr/sbin/asterisk -rx 'logger reload' > /dev/null 2> /dev/null endscript } As asterisk is running by user: root so no need set asterisk permissions 'create 0640 asterisk asterisk' in above configuration. Please advise so I can resolve this issue. -- Regards, Ahmed Munir Chohan -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20130521/3e08ee10/attachment.htm>
On 21/5/13 4:19 pm, Ahmed Munir wrote:> Last year, I installed Asterisk 10.4.2 and enabled logrotate on daily basis> which was working perfect. Now in couple of months back, the logrotate > feature is not working at all but simply appending the logs in 'messages' > file. Listing down down the configuration for logrotate below;This sounds more like a Linux/logrotate issue rather than asterisk-specific. Are your other system logfiles successfully rotating? (e.g. /var/log/messages) If not, it may be something as simple as logrotate's daemon not running. You should be able to fix that in your distro's startup scripts. On Gentoo, you'd do something like "/etc/init.d/logrotate start" to start it now, and "rc-update add logrotate default" to add it to your default runlevel. Difficult to advise further without knowing the distro in question. Kind regards, Chris -- This email is made from 100% recycled electrons
On 05/21/2013 10:19 AM, Ahmed Munir wrote:> Hi, > > Last year, I installed Asterisk 10.4.2 and enabled logrotate on daily > basis which was working perfect. Now in couple of months back, the > logrotate feature is not working at all but simply appending the logs > in 'messages' file. Listing down down the configuration for logrotate > below; > > /var/log/asterisk/messages { > missingok > rotate 5 > daily > postrotate > /usr/sbin/asterisk -rx 'logger reload' > /dev/null 2> /dev/null > endscript > } > > As asterisk is running by user: root so no need set asterisk > permissions 'create 0640 asterisk asterisk' in above configuration. > > Please advise so I can resolve this issue. >I believe you want to execute "logger rotate", rather than "logger reload".
Checked in /var/logs/ directory, all logs are not rotating by logrotate. Please advise how can I overcome this issue as I'm using CentoOS 5 From: Chris Bagnall <asterisk at lists.minotaur.cc>> Subject: Re: [asterisk-users] Asterisk Log rotate not working > To: asterisk-users at lists.digium.com > Message-ID: <519B9FA6.9000506 at lists.minotaur.cc> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On 21/5/13 4:19 pm, Ahmed Munir wrote:> Last year, I installed Asterisk > 10.4.2 and enabled logrotate on daily basis > > which was working perfect. Now in couple of months back, the logrotate > > feature is not working at all but simply appending the logs in 'messages' > > file. Listing down down the configuration for logrotate below; > > This sounds more like a Linux/logrotate issue rather than > asterisk-specific. Are your other system logfiles successfully rotating? > (e.g. /var/log/messages) > > If not, it may be something as simple as logrotate's daemon not running. > You should be able to fix that in your distro's startup scripts. > > On Gentoo, you'd do something like "/etc/init.d/logrotate start" to > start it now, and "rc-update add logrotate default" to add it to your > default runlevel. > > Difficult to advise further without knowing the distro in question. > > Kind regards, > > Chris > -- > This email is made from 100% recycled electrons > > >-- Regards, Ahmed Munir Chohan -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20130521/3aec2f2a/attachment.htm>
Jim, Cron and Logrotate already installed in my machine and already configured as the steps you enlisted. But still logrotate is not running. Date: Tue, 21 May 2013 12:28:31 -0700> From: Jim Lucas <lists at cmsws.com> > Subject: Re: [asterisk-users] Asterisk Log rotate not working > To: Asterisk Users Mailing List - Non-Commercial Discussion > <asterisk-users at lists.digium.com> > Message-ID: <519BCADF.1000305 at cmsws.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On 5/21/2013 11:54 AM, Ahmed Munir wrote: > > Checked in /var/logs/ directory, all logs are not rotating by logrotate. > > Please advise how can I overcome this issue as I'm using CentoOS 5 > > Ahmed, > > Proper log rotation depends on a couple things working together > correctly to get the job done. First, you need to make sure you have > the space to rotate the logs. If you have compression enabled, > logrotate creates a copy of the file(s) as it compresses them. You > could be running out of space??? > > Next you need to verify that everything is in place, follow these steps > to do so. Keep in mind that I have CentOS 6.4. So the packages might > differ a little in the name and surely in the version numbering. > > 1) Verify logrotate is installed to your system. > # yum install logrotate > > if it asks you to install it, do so. > > 2) Verify that crond is installed and running. > Below is the output I get when searching yum to see if crond is > installed. If your query returns nothing then crond is not installed. > > [root at jim etc]# yum list all | grep ^cron | grep "@" > cronie.x86_64 1.4.4-7.el6 > @anaconda-CentOS-201303020151.x86_64/6.4 > cronie-anacron.x86_64 1.4.4-7.el6 > @anaconda-CentOS-201303020151.x86_64/6.4 > crontabs.noarch 1.10-33.el6 > @anaconda-CentOS-201303020151.x86_64/6.4 > > If crond is not installed, then you will need to install it. Once > you have it installed, move on to the next step. > > 3) Make sure crond is setup to start at boot time. > > chkconfig crond on > > 4) Verify that logrotate is in one of the cron include folders. Mine > is located in the cron.daily folder. > > [root at jim etc]# find /etc/*/logrotate > /etc/cron.daily/logrotate > > If you don't find that the above file exists, you might need to > re-install logrotate. > > Next I would've had you verify that you have a config file in > /etc/logrotate.d/ for the asterisk log files. But it seems you already > to. After all this, if it still isn't working, double check all the > steps above. > > Let us know if this does or doesn't help. > > -- > Jim Lucas > > > >-- Regards, Ahmed Munir Chohan -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20130522/4225c111/attachment.htm>