Symptoms
- /var/log/hspc/*.log files are not rotated
- there are no enough diskspace inside HSPcomplete VE
Resolution
Please use the following steps to resolve logrotation issue:- ensure that there is enough diskspace to rotate /var/log/hspc/*.log files - free diskspace size should be greater than size of every /var/log/hspc/*.log file:
# ls -1Ssh /var/log/hspc/*.log
# df -h- If there are no enough diskspace please check this article to solve diskspace shortage issue
- check if crond service is configured to be running in current runlevel and is running:
# /etc/init.d/crond status
crond (pid 32193) is running...
# runlevel
N 3
# chkconfig --list crond
crond 0:off 1:off 2:on 3:on 4:on 5:on 6:offaccording to the output above crond is running, and enabled for current runlevel (3)- In case crond service is stopped please use the following command to start crond:
# chkconfig crond --levels 2345 on
# /etc/init.d/crond start
Starting crond: [ OK ]
- In case crond service is stopped please use the following command to start crond:
- ensure that `logrotate /etc/logrotate.d/hspc` command is working correctly:
logrotate configuration for /var/log/hspc/*.log files is stored in /etc/logrotate.d/hspc file, cron is just executing `logrotate /etc/logrotate.d/hspc` to rotate this files, so to reproduce the issue with rotation it is enough to execute the following command:
# logrotate /etc/logrotate.d/hspc- In case command is executed successfully - logrotate is working correctly
- In case command is failed or hanged - please terminate existing instances of logrotate, execute the following command:and try to perform logrotation once again
# mv /var/lib/logrotate.status /var/lib/logrotate.status.old
Keywords: logrotate,disk space