LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   help with my tail -f problem (https://www.linuxquestions.org/questions/linux-newbie-8/help-with-my-tail-f-problem-656138/)

s3ns4i 07-16-2008 09:43 AM

help with my tail -f problem
 
Hi guys/girls. I was wondering if anyone has see this issue I'm having on any of their Linux boxes. I'm running RedHat 7.1 on this box. The issue I'm having is when I use the tail -f filename it will not follow the file and stops halfway through reading the file. This is while going through a ssh connection. I can read the file just fine using the more or cat command and the file is not larger than 2gigs. It does this on all log files on the box. Any help or tips to help me solve this issue would be greatly appreciated.

Thanks,

Edit: the program I'm using to do the logging is working fine on all of my other 10 boxes running the same version of RedHat. Thanks again for any help.

Sensai

pruneau 07-16-2008 09:55 AM

Could you give some precisions: when the tail hangs, are you sure it's a tail problem, or is the connections simply hanging ? Try to assess this by pressing ctrl-c and see if you get back to the prompt.
Otherwise, it could be a classical problem of log rotation: i.e. when you tail a file, and it's being rotated by some utility (like logrotate), then it changes name, and tail of course loses the trail, if you excuse the bad pun.
You could try and diagnose the problem by creating a debug log file of your doing by using a bash while() loop or a command like "iostat -k 10 > yourfile", and "tail -f yourfile" to see whether this is a general bug of tail.
Now, of course, one has to ask why you are using such an old distribution ?

s3ns4i 07-16-2008 10:13 AM

Thanks for your quick reply. I'm unable to upgrade because these are production machines and we are unable to upgrade at the moment. It seems that after further looking into the issue, that problem is indeed the log rotate issue. I have it working again now, again thanks for your help.


All times are GMT -5. The time now is 02:28 PM.