sorvani
(Jared Busch)
February 19, 2022, 7:48pm
1
Have not yet done troubleshooting, but as you can see the log stopped rotating 6 days ago.
This system is now FreePBX 16, but had the same problem multiple times int he past on FreePBX 15. I previously posted about it in this thread .
I do not have a PM2 instance holding reload logs open this time.
sudo -u asterisk /usr/sbin/logrotate -s /var/lib/logrotate/logrotate.status /etc/logrotate.conf
Logrotate says it ran, but obviously not.
Edit:
Ran updates. Nothing log related.
dicko
(dicko)
February 19, 2022, 8:46pm
2
logrotate -v -f /etc/logrotate.conf
will effectively force (-f) and be verbose (-v) as it rotates all configured rotations in /etc/logrotate.d, chances are that you might need to add an ‘su asterisk asterisk’ directive in all your stanzas related to asterisk logs
sorvani
(Jared Busch)
February 19, 2022, 11:58pm
3
No one said I wanted to rotate all the logs.
I edited /var/lib/logrotate/logrotate.satus
and backed the date up one point for fail2ban
and full
.
Edit: first try failed because I left a -d (debug switch in)
Then I ran logrotate again and it rotated them.
PitzKey
(Itzik)
February 20, 2022, 12:07am
4
Whats the output of
cat /etc/logrotate.d/asterisk
sorvani
(Jared Busch)
February 20, 2022, 12:10am
5
The relevant section has the correct information.
The problem is that this is a recurring issue, but lograte itself has no logs.
Something is very obviously broken when logrotate.status
says the file was rotated, but it very obviosuly was not.
sorvani
(Jared Busch)
February 20, 2022, 12:13am
6
Side note… Permissions are wrong in /etc/logrotate.d/asterisk
It is creating the new file as 640, but `fwconsole chown sets the file to 664
dicko
(dicko)
February 20, 2022, 12:44am
7
You can run individually anything in /etc/logrotate* with any arguments you choose and as any user.
But the ‘system’ (cron) will run logrotate as the root user
ls -l /etc/cron.daily/logrotate
whilst trouble shooting, I suggest you do exactly that ,i.e. as root, not asterisk. We see it used to run successfully at 04:02 until last week but now runs successfully and , presumably as asterisk, at your whim but not as a cron job.
sorvani
(Jared Busch)
February 20, 2022, 8:28pm
8
So I rebooted last night after updates. Of course this will reset everything. But this is what I found this morning.
sorvani
(Jared Busch)
March 9, 2022, 1:01am
9
Found another system doing this today. This is getting really, really, really old.
3 Likes
dicko
(dicko)
March 9, 2022, 1:50am
10
What is the content of your
/etc/logrotate.d/asterisk
?
and does
logrotate -v -f /etc/logrotate.d/asterisk
throw any oopsies?
system
(system)
Closed
April 9, 2022, 1:50am
11
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.