Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
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.
I have a really annoying problem and I'm running out of ideas!
I have an application that is quite noisy with syslog. Under heavy load, the application sometimes crashes during log rotation but very rarely. We are talking maybe once every two months. It restarts without any problems but its very important that this application does not crash. I don't seem to be able to recreate the problem in gdb so I'm not even entirely sure exactly what the application is doing at the time of crash.
There is nothing obvious in the logs, they look essentially exactly the same as a successful rotation.
Are you getting a core file? If so, make sure you have not stripped symbols and have compiled with a -g option (e.g., -O2 -g or just -g). Then attack with gdb. I usually get burned (application crashing) due to syslog being called from signal level.
I you're not getting a core file, make sure the kernel is optioned to generate cores (/proc file setting). Remember syslog() has interwrite issues when called from signal level. Does logrotate signal syslogd to restart with a new logfile after rotation is complete; syslog() may also have interwrite issues for this case as well.
You might consider writing a test program that hammers on syslog() then in another window issue your logrotate command (just like cron does).