Hi everyone!
I am having a problem that Logrotate works correctly then stops working. In this last case it worked for 7 days after a reboot, then stopped rotating the logs (I’m really just mainly concerned about the “full” log):
[root@freepbx ~]# ls -l /var/log/asterisk/full*
-rw-r----- 1 asterisk asterisk 64711786 Oct 19 09:51 /var/log/asterisk/full
-rw-r----- 1 asterisk asterisk 7112689 Oct 8 03:22 /var/log/asterisk/full-20211008
-rw-r----- 1 asterisk asterisk 24702273 Oct 9 03:25 /var/log/asterisk/full-20211009
-rw-r----- 1 asterisk asterisk 599871 Oct 10 03:20 /var/log/asterisk/full-20211010
-rw-r----- 1 asterisk asterisk 348038 Oct 11 03:24 /var/log/asterisk/full-20211011
-rw-r----- 1 asterisk asterisk 16249144 Oct 12 03:28 /var/log/asterisk/full-20211012
-rw-r----- 1 asterisk asterisk 18314454 Oct 13 03:07 /var/log/asterisk/full-20211013
-rw-r----- 1 asterisk asterisk 20116047 Oct 14 03:32 /var/log/asterisk/full-20211014
Here is what happens when I try to run logrotate manually:
[root@freepbx ~]# /usr/sbin/logrotate -s /var/lib/logrotate/logrotate.status /etc/logrotate.conf -d
reading config file /etc/logrotate.conf
including /etc/logrotate.d
reading config file apcupsd
reading config file asterisk
reading config file bootlog
reading config file chrony
reading config file fail2ban
reading config file freepbx-core
reading config file freepbx-qcallback
reading config file freepbx-restapps
reading config file freepbx-sangomacrm
reading config file freepbx-ucp
reading config file freepbx-zulu
reading config file httpd
reading config file iscsiuiolog
reading config file mariadb
reading config file mongodb
reading config file oc_logrotate
reading config file pms
reading config file psacct
reading config file radiusd
reading config file redis
reading config file sangomaconnect
reading config file smartoffice
reading config file syslog
reading config file vsftpd
reading config file wpa_supplicant
reading config file yum
Allocating hash table for state file, size 15360 B
Handling 37 logs
rotating pattern: /var/log/apcupsd.events after 1 days (14 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/apcupsd.events
log /var/log/apcupsd.events does not exist – skipping
rotating pattern: /var/log/asterisk/queue_log after 1 days (30 rotations)
empty log files are not rotated, old logs are removed
switching euid to 995 and egid to 995
considering log /var/log/asterisk/queue_log
log does not need rotating (log has been rotated at 2021-10-19 3:48, that is not day ago yet)
switching euid to 0 and egid to 0
rotating pattern: /var/spool/mail/asterisk after 1 days (7 rotations)
empty log files are not rotated, old logs are removed
switching euid to 995 and egid to 12
considering log /var/spool/mail/asterisk
log does not need rotating (log has been rotated at 2021-10-19 3:48, that is not day ago yet)
switching euid to 0 and egid to 0
rotating pattern: /var/log/asterisk/messages
/var/log/asterisk/event_log
/var/log/asterisk/full
/var/log/asterisk/dtmf
/var/log/asterisk/fail2ban after 1 days (7 rotations)
empty log files are not rotated, old logs are removed
switching euid to 995 and egid to 995
considering log /var/log/asterisk/messages
log /var/log/asterisk/messages does not exist – skipping
considering log /var/log/asterisk/event_log
log /var/log/asterisk/event_log does not exist – skipping
considering log /var/log/asterisk/full
log does not need rotating (log has been rotated at 2021-10-19 3:48, that is not day ago yet)
considering log /var/log/asterisk/dtmf
log /var/log/asterisk/dtmf does not exist – skipping
considering log /var/log/asterisk/fail2ban
log does not need rotating (log has been rotated at 2021-10-19 3:48, that is not day ago yet)
not running postrotate script, since no logs were rotated
switching euid to 0 and egid to 0
rotating pattern: /var/log/boot.log
after 1 days (7 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/boot.log
log does not need rotating (log is empty)
rotating pattern: /var/log/chrony/.log after 1 days (14 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/chrony/.log
log /var/log/chrony/*.log does not exist – skipping
not running postrotate script, since no logs were rotated
rotating pattern: /var/log/fail2ban.log 30720 bytes (14 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/fail2ban.log
log does not need rotating (log size is below the ‘size’ threshold)
rotating pattern: /var/log/asterisk/freepbx_dbug 524288000 bytes (7 rotations)
empty log files are not rotated, old logs are removed
switching euid to 995 and egid to 995
considering log /var/log/asterisk/freepbx_dbug
log /var/log/asterisk/freepbx_dbug does not exist – skipping
switching euid to 0 and egid to 0
rotating pattern: /var/log/asterisk/freepbx_debug
/var/log/asterisk/freepbx.log
/var/log/asterisk/freepbx_security.log 104857600 bytes (7 rotations)
empty log files are not rotated, old logs are removed
switching euid to 995 and egid to 995
considering log /var/log/asterisk/freepbx_debug
log /var/log/asterisk/freepbx_debug does not exist – skipping
considering log /var/log/asterisk/freepbx.log
log does not need rotating (log size is below the ‘size’ threshold)
considering log /var/log/asterisk/freepbx_security.log
log does not need rotating (log size is below the ‘size’ threshold)
switching euid to 0 and egid to 0
rotating pattern: /var/log/asterisk/core-fastagi_*.log 52428800 bytes (5 rotations)
empty log files are not rotated, old logs are removed
switching euid to 995 and egid to 995
considering log /var/log/asterisk/core-fastagi_err.log
log does not need rotating (log size is below the ‘size’ threshold)
considering log /var/log/asterisk/core-fastagi_out.log
log does not need rotating (log size is below the ‘size’ threshold)
not running postrotate script, since no logs were rotated
switching euid to 0 and egid to 0
rotating pattern: /var/log/asterisk/qcallback_.log 52428800 bytes (5 rotations)
empty log files are not rotated, old logs are removed
switching euid to 995 and egid to 995
considering log /var/log/asterisk/qcallback_.log
log /var/log/asterisk/qcallback_*.log does not exist – skipping
not running postrotate script, since no logs were rotated
switching euid to 0 and egid to 0
rotating pattern: /var/log/asterisk/restapps_*.log 52428800 bytes (5 rotations)
empty log files are not rotated, old logs are removed
switching euid to 995 and egid to 995
considering log /var/log/asterisk/restapps_err.log
log does not need rotating (log size is below the ‘size’ threshold)
considering log /var/log/asterisk/restapps_out.log
log does not need rotating (log size is below the ‘size’ threshold)
not running postrotate script, since no logs were rotated
switching euid to 0 and egid to 0
rotating pattern: /var/log/asterisk/dpmaapps.log 104857600 bytes (7 rotations)
empty log files are not rotated, old logs are removed
switching euid to 995 and egid to 995
considering log /var/log/asterisk/dpmaapps.log
log /var/log/asterisk/dpmaapps.log does not exist – skipping
switching euid to 0 and egid to 0
rotating pattern: /var/log/asterisk/sangomacrm*.log 52428800 bytes (5 rotations)
empty log files are not rotated, old logs are removed
switching euid to 995 and egid to 995
considering log /var/log/asterisk/sangomacrm*.log
log /var/log/asterisk/sangomacrm*.log does not exist – skipping
switching euid to 0 and egid to 0
rotating pattern: /var/log/asterisk/ucp_*.log 52428800 bytes (5 rotations)
empty log files are not rotated, old logs are removed
switching euid to 995 and egid to 995
considering log /var/log/asterisk/ucp_err.log
log does not need rotating (log size is below the ‘size’ threshold)
considering log /var/log/asterisk/ucp_out.log
log does not need rotating (log size is below the ‘size’ threshold)
not running postrotate script, since no logs were rotated
switching euid to 0 and egid to 0
rotating pattern: /var/log/asterisk/zulu_*.log 52428800 bytes (5 rotations)
empty log files are not rotated, old logs are removed
switching euid to 995 and egid to 995
considering log /var/log/asterisk/zulu_out.log
log does not need rotating (log size is below the ‘size’ threshold)
not running postrotate script, since no logs were rotated
switching euid to 0 and egid to 0
rotating pattern: /var/log/httpd/*log after 1 days (14 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/httpd/access_log
log does not need rotating (log has been rotated at 2021-10-19 3:48, that is not day ago yet)
considering log /var/log/httpd/error_log
log does not need rotating (log has been rotated at 2021-10-19 3:48, that is not day ago yet)
considering log /var/log/httpd/ssl_access_log
log does not need rotating (log is empty)considering log /var/log/httpd/ssl_error_log
log does not need rotating (log has been rotated at 2021-10-19 3:48, that is not day ago yet)
considering log /var/log/httpd/ssl_request_log
log does not need rotating (log is empty)not running postrotate script, since no logs were rotated
rotating pattern: /var/log/iscsiuio.log weekly (4 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/iscsiuio.log
log /var/log/iscsiuio.log does not exist – skipping
not running postrotate script, since no logs were rotated
rotating pattern: /var/log/mongodb/*.log weekly (10 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/mongodb/mongod.log
log does not need rotating (log has been rotated at 2021-10-17 3:50, that is not week ago yet)
rotating pattern: /var/log/asterisk/oracle_connector.log
/var/log/asterisk/oracle_engine_err.log
/var/log/asterisk/oracle_engine_out.log after 1 days (15 rotations)
empty log files are not rotated, old logs are removed
switching euid to 995 and egid to 995
considering log /var/log/asterisk/oracle_connector.log
log /var/log/asterisk/oracle_connector.log does not exist – skipping
considering log /var/log/asterisk/oracle_engine_err.log
log /var/log/asterisk/oracle_engine_err.log does not exist – skipping
considering log /var/log/asterisk/oracle_engine_out.log
log /var/log/asterisk/oracle_engine_out.log does not exist – skipping
switching euid to 0 and egid to 0
rotating pattern: /var/log/asterisk/pms.log after 1 days (15 rotations)
empty log files are not rotated, old logs are removed
switching euid to 995 and egid to 995
considering log /var/log/asterisk/pms.log
log does not need rotating (log has been rotated at 2021-10-19 3:48, that is not day ago yet)
switching euid to 0 and egid to 0
rotating pattern: /var/account/pacct after 1 days (31 rotations)
empty log files are not rotated, old logs are removed
considering log /var/account/pacct
log does not need rotating (log is empty)
rotating pattern: /var/log/radius/radacct//detail monthly (4 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/radius/radacct//detail
rotating pattern: /var/log/radius/checkrad.log monthly (4 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/radius/checkrad.log
log /var/log/radius/checkrad.log does not exist – skipping
rotating pattern: /var/log/radius/radius.log monthly (4 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/radius/radius.log
log /var/log/radius/radius.log does not exist – skipping
rotating pattern: /var/log/radius/radwtmp monthly (4 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/radius/radwtmp
log /var/log/radius/radwtmp does not exist – skipping
rotating pattern: /var/log/radius/sqltrace.sql monthly (4 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/radius/sqltrace.sql
log /var/log/radius/sqltrace.sql does not exist – skipping
rotating pattern: /var/log/redis/*.log weekly (10 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/redis/redis.log
log does not need rotating (log has been rotated at 2021-10-17 3:50, that is not week ago yet)
rotating pattern: /var/log/asterisk/sangomaconnect.log 52428800 bytes (10 rotations)
empty log files are not rotated, old logs are removed
switching euid to 995 and egid to 995
considering log /var/log/asterisk/sangomaconnect.log
log /var/log/asterisk/sangomaconnect.log does not exist – skipping
not running postrotate script, since no logs were rotated
switching euid to 0 and egid to 0
rotating pattern: /var/log/asterisk/iot-server.log 52428800 bytes (10 rotations)
empty log files are not rotated, old logs are removed
switching euid to 995 and egid to 995
considering log /var/log/asterisk/iot-server.log
log does not need rotating (log size is below the ‘size’ threshold)
not running postrotate script, since no logs were rotated
switching euid to 0 and egid to 0
rotating pattern: /var/log/cron
/var/log/maillog
/var/log/messages
/var/log/secure
/var/log/spooler
after 1 days (14 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/cron
log does not need rotating (log has been rotated at 2021-10-19 3:48, that is not day ago yet)
considering log /var/log/maillog
log does not need rotating (log has been rotated at 2021-10-19 3:48, that is not day ago yet)
considering log /var/log/messages
log does not need rotating (log has been rotated at 2021-10-19 3:48, that is not day ago yet)
considering log /var/log/secure
log does not need rotating (log has been rotated at 2021-10-19 3:48, that is not day ago yet)
considering log /var/log/spooler
log does not need rotating (log has been rotated at 2021-10-19 3:48, that is not day ago yet)
not running postrotate script, since no logs were rotated
rotating pattern: /var/log/vsftpd.log after 1 days (14 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/vsftpd.log
log does not need rotating (log has been rotated at 2021-10-19 3:48, that is not day ago yet)
rotating pattern: /var/log/xferlog after 1 days (14 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/xferlog
log /var/log/xferlog does not exist – skipping
rotating pattern: /var/log/wpa_supplicant.log 30720 bytes (14 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/wpa_supplicant.log
log does not need rotating (log size is below the ‘size’ threshold)
rotating pattern: /var/log/yum.log yearly (14 rotations)
empty log files are not rotated, log files >= 30720 are rotated earlier, old logs are removed
considering log /var/log/yum.log
log does not need rotating (log has been rotated at 2021-10-7 11:50, that is not year ago yet)
rotating pattern: /var/log/wtmp monthly (1 rotations)
empty log files are rotated, only log files >= 1048576 bytes are rotated, old logs are removed
considering log /var/log/wtmp
log does not need rotating (log has been rotated at 2021-10-7 12:31, that is not month ago yet)
log does not need rotating (‘misinze’ directive is used and the log size is smaller than the minsize value
rotating pattern: /var/log/btmp monthly (1 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/btmp
log does not need rotating (log has been rotated at 2021-10-7 12:31, that is not month ago yet)
After reviewing posting Logrotate Bug?, I looked for the pm2 script/process running. I don’t see it:
[root@freepbx ~]# ps -ef |grep pm2
asterisk 14827 1 0 Oct07 ? 00:11:03 PM2 v4.5.0: God Daemon (/home/asterisk/.pm2)
root 48370 45643 0 09:55 pts/0 00:00:00 grep --color=auto pm2
Here are the modules installed. I am a bit hesitant to upgrade everything (without a specific knowledge about what will resolve this issue) since this is a production system:
[root@freepbx ~]# fwconsole ma list
No repos specified, using: [standard,commercial] from last GUI settings
±---------------------±-----------±--------±------------+
| Module | Version | Status | License |
±---------------------±-----------±--------±------------+
| accountcodepreserve | 13.0.2.2 | Enabled | GPLv2 |
| adv_recovery | 15.0.36 | Enabled | Commercial |
| amd | 15.0.3 | Enabled | GPLv3+ |
| announcement | 15.0.3.13 | Enabled | GPLv3+ |
| api | 15.0.3.15 | Enabled | AGPLv3+ |
| areminder | 15.0.14.24 | Enabled | Commercial |
| arimanager | 15.0.3.11 | Enabled | GPLv3+ |
| asterisk-cli | 14.0.4 | Enabled | GPLv3+ |
| asteriskinfo | 15.0.14 | Enabled | GPLv3+ |
| backup | 15.0.10.61 | Enabled | GPLv3+ |
| blacklist | 15.0.2.14 | Enabled | GPLv3+ |
| broadcast | 15.0.13 | Enabled | Commercial |
| builtin | | Enabled | |
| bulkhandler | 13.0.23 | Enabled | GPLv3+ |
| calendar | 15.0.4.21 | Enabled | GPLv3+ |
| callaccounting | 15.0.24 | Enabled | Commercial+ |
| callback | 15.0.12 | Enabled | GPLv3+ |
| callerid | 15.0.16 | Enabled | Commercial |
| callforward | 15.0.16 | Enabled | AGPLv3+ |
| calllimit | 15.0.5.6 | Enabled | Commercial |
| callrecording | 15.0.7.18 | Enabled | AGPLv3+ |
| callwaiting | 15.0.4.6 | Enabled | GPLv3+ |
| cdr | 15.0.17.10 | Enabled | GPLv3+ |
| cel | 15.0.15.13 | Enabled | GPLv3+ |
| certman | 15.0.45 | Enabled | AGPLv3+ |
| cidlookup | 15.0.20 | Enabled | GPLv3+ |
| conferences | 15.0.7.11 | Enabled | GPLv3+ |
| conferencespro | 15.0.3.18 | Enabled | Commercial |
| configedit | 13.0.7.3 | Enabled | AGPLv3+ |
| contactmanager | 15.0.8.34 | Enabled | GPLv3+ |
| core | 15.0.12.73 | Enabled | GPLv3+ |
| cos | 15.0.14 | Enabled | Commercial |
| customappsreg | 15.0.14 | Enabled | GPLv3+ |
| cxpanel | 15.0.4 | Enabled | GPLv3 |
| dahdiconfig | 15.0.5.7 | Enabled | GPLv3+ |
| dashboard | 15.0.12 | Enabled | AGPLv3+ |
| daynight | 15.0.12 | Enabled | GPLv3+ |
| dictate | 15.0.7 | Enabled | GPLv3+ |
| digium_phones | 15.0.6 | Enabled | GPLv2 |
| digiumaddoninstaller | 13.0.1.1 | Enabled | GPLv2 |
| directory | 15.0.18 | Enabled | GPLv3+ |
| disa | 15.0.4.9 | Enabled | AGPLv3+ |
| donotdisturb | 15.0.10 | Enabled | GPLv3+ |
| dynroute | 15.0.2 | Enabled | GPLv3+ |
| endpoint | 15.0.39.93 | Enabled | Commercial |
| extensionroutes | 15.0.8 | Enabled | Commercial |
| extensionsettings | 13.0.4 | Enabled | GPLv3+ |
| fax | 15.0.21 | Enabled | GPLv3+ |
| faxpro | 15.0.8.13 | Enabled | Commercial |
| featurecodeadmin | 13.0.6.11 | Enabled | GPLv3+ |
| filestore | 15.0.3.19 | Enabled | AGPLv3 |
| findmefollow | 15.0.27 | Enabled | GPLv3+ |
| framework | 15.0.17.43 | Enabled | GPLv2+ |
| fw_langpacks | 14.0.1 | Enabled | GPLv3+ |
| hotelwakeup | 15.0.5.5 | Enabled | GPLv2 |
| iaxsettings | 15.0.8 | Enabled | AGPLv3 |
| infoservices | 15.0.3 | Enabled | GPLv2+ |
| iotserver | 15.0.3.3 | Enabled | Commercial |
| irc | 13.0.1 | Enabled | GPLv3+ |
| ivr | 15.0.29 | Enabled | GPLv3+ |
| languages | 15.0.12 | Enabled | GPLv3+ |
| logfiles | 15.0.14 | Enabled | GPLv3+ |
| manager | 15.0.12 | Enabled | GPLv2+ |
| miscapps | 15.0.10 | Enabled | GPLv3+ |
| miscdests | 15.0.2.12 | Enabled | GPLv3+ |
| music | 15.0.22 | Enabled | GPLv3+ |
| oracle_connector | 15.0.9 | Enabled | Commercial |
| outroutemsg | 15.0.9 | Enabled | GPLv3+ |
| paging | 15.0.4.32 | Enabled | GPLv3+ |
| pagingpro | 15.0.1.22 | Enabled | Commercial |
| parking | 15.0.15.4 | Enabled | GPLv3+ |
| parkpro | 15.0.13 | Enabled | Commercial |
| pbdirectory | 2.11.0.6 | Enabled | GPLv3+ |
| phonebook | 15.0.12 | Enabled | GPLv3+ |
| phpinfo | 13.0.2 | Enabled | GPLv2+ |
| pinsets | 15.0.1.15 | Enabled | GPLv3+ |
| pinsetspro | 15.0.4 | Enabled | Commercial |
| pm2 | 15.0.6 | Enabled | AGPLv3+ |
| pms | 15.0.2.53 | Enabled | Commercial |
| presencestate | 15.0.11 | Enabled | GPLv3+ |
| printextensions | 13.0.3.4 | Enabled | GPLv3+ |
| queueprio | 15.0.10 | Enabled | GPLv3+ |
| queues | 15.0.33 | Enabled | GPLv2+ |
| queuestats | 15.0.3.33 | Enabled | Commercial |
| qxact_reports | 15.0.3.34 | Enabled | Commercial |
| recording_report | 15.0.4.34 | Enabled | Commercial |
| recordings | 15.0.3.15 | Enabled | GPLv3+ |
| restapps | 15.0.19.49 | Enabled | Commercial |
| ringgroups | 15.0.11.14 | Enabled | GPLv3+ |
| sangomaconnect | 15.0.25.5 | Enabled | Commercial |
| sangomacrm | 15.0.23.1 | Enabled | Commercial |
| setcid | 15.0.9 | Enabled | GPLv3+ |
| sipsettings | 15.0.6.39 | Enabled | AGPLv3+ |
| sipstation | 15.0.5.23 | Enabled | Commercial |
| sms | 15.0.18 | Enabled | Commercial |
| soundlang | 15.0.5.10 | Enabled | GPLv3+ |
| speeddial | 2.11.0.4 | Enabled | GPLv3+ |
| superfecta | 15.0.2.32 | Enabled | GPLv2+ |
| sysadmin | 15.0.21.72 | Enabled | Commercial |
| timeconditions | 15.0.15.10 | Enabled | GPLv3+ |
| tts | 15.0.11 | Enabled | GPLv3+ |
| ttsengines | 15.0.4.7 | Enabled | AGPLv3 |
| ucp | 15.0.6.29 | Enabled | AGPLv3+ |
| userman | 15.0.41 | Enabled | AGPLv3+ |
| vega | 15.0.11 | Enabled | Commercial+ |
| vmblast | 15.0.11.6 | Enabled | GPLv3+ |
| vmnotify | 15.0.12 | Enabled | Commercial |
| voicemail | 15.0.18.35 | Enabled | GPLv3+ |
| voicemail_report | 15.0.6 | Enabled | Commercial |
| vqplus | 15.0.7.22 | Enabled | Commercial |
| weakpasswords | 13.0.2 | Enabled | GPLv3+ |
| webcallback | 15.0.6.3 | Enabled | Commercial |
| webrtc | 15.0.10 | Enabled | GPLv3+ |
| xmpp | 15.0.6.9 | Enabled | AGPLv3 |
| zulu | 15.0.58.12 | Enabled | Commercial |
±---------------------±-----------±--------±------------+
I would certainly appreciate if anyone has any direction for me. I am glad to just put a workaround logrotate (or something else) in cron, but I’m not sure what to put because I don’t see any CPU-consuming run-away processes and I can’t run logrotate by hand.
Thanks! Dave