Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Logrotate will not correctly roll the logs, despite many httpd restarts ( new pids checked and correspond ) and forced manual logrotates.
August 18 and 23 show my forced logrotates.
-rw-r--r-- 1 root root 0 Aug 19 04:02 access_log
-rw-r--r-- 1 root root 660003669 Aug 23 11:51 access_log.1
-rw-r--r-- 1 root root 0 Aug 12 04:03 access_log.2
-rw-r--r-- 1 root root 0 Aug 11 04:03 access_log.3
-rw-r--r-- 1 root root 0 Aug 10 04:03 access_log.4
-rw-r--r-- 1 root root 1573047575 Aug 18 10:40 access_log.5
After a forced logrotate, httpd will start to log to access.log and the problem appears solved. However when the logs rotate out of cron.daily as speficied, apache keeps writing to the old log.
This exact configuration is working on another machine, which did show similar symptoms but resolved itself after a force and restart. So this is a known working configuration.
I've run into this; I think I "solved" it by restarting apache instead of just HUPing it. You might also try logrotate's "copytruncate" option. Now, subscribing to this topic because I want to know a better way..
thanks AlucardZero, ive restarted httpd, not just HUP'd it manually and it did seem to work, until next time it ran and HUP'd from cron.
What bothers me is that these machines are identical, suffered from the same issue, but one is fixed and one isnt. Im starting to think theres a bug somewhere. The 'easy way' would be to rewrite the logrotate conf to restart httpd but its a bodge, not a solution.
Im also aware of 'copytruncate' but using this method means loging some logs. Im not sure i want to do that.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.