Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have to tail the log of a server (servicemix) and the log rotation is enabled. As soon as the rotation happens, tail stops displaying. I did some investigations and it is a bug in Debian : Debian Bug Report. The bug has been around for a long time ago. Does anyone knows if this bug in Ubuntu is to be fixed?

I'm on Ubuntu 12.04 64 bit. I don't have to mention that this bug is total hell! Every time I have the problem, I have to interrupt the command tail and re-execute the command!

share|improve this question
    
It is true that I can disable the log rotation. But I would like this problem to be fixed... –  Rudy Vissers Oct 18 '12 at 10:33
add comment

2 Answers

As stated in the bug report, you can bypass the malfunctioning inotify code with:

tail ---disable-inotify servicemix.log

It will then use an older polling behavior.

share|improve this answer
    
I have just tested the workaround and it does not avoid tail to block... :-( –  Rudy Vissers Oct 18 '12 at 14:38
    
I did a second check and it is indeed the case on ubuntu 12.04 and debian...tail not working... That is not acceptable... –  Rudy Vissers Oct 19 '12 at 11:46
    
@RudyVissers Have you filed a bug report with Ubuntu yet? –  hexafraction Oct 19 '12 at 13:33
1  
I understand that this is not acceptable for you, but it may be of nu use to complain here as coreutuils is from Debian. Since this problem is not localized to Ubuntu, it is best to ask at Unix & Linux. –  hexafraction Oct 19 '12 at 13:46
    
You are right and I will do that as soon as I find some time. –  Rudy Vissers Oct 31 '12 at 9:03
add comment

You can automate the interruption and resumption of your tail command by adding the requisite commands to your logrotate configs. See https://help.ubuntu.com/community/LinuxLogFiles#Log_Rotation - in short, you will probably want to put the command in /etc/cron.daily/logrotate, the system-wide crontab which handles rotation.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.