Tiny Core Linux
Tiny Core Base => TCB Talk => Topic started by: nurbles on November 01, 2023, 09:38:19 AM
-
I'm using Linux version 6.1.2-tinycore64 (tc@box) (gcc (GCC) 12.2.0, GNU ld (GNU Binutils) 2.39) #612 SMP Mon Jan 2 17:24:30 UTC 2023 and the tail command isn't working correctly. It logs between 100 and 200 lines and then just stops showing anything. If I use Ctrl+C and restart the tail it works for another couple hundred lines or so. The exact command I'm using is
tc@mybox:~$ tail -f /var/log/messages
I know that's correct and it works on my Ubuntu systems, so what could I be doing that is causing tail to stop writing anything to the display (or maybe stop reading the log)?
-
Hi nurbles
... It logs between 100 and 200 lines and then just stops showing anything. ...
I just tried this under TC14 x86_64 (6.1.2-tinycore64).
Opened a terminal and entered:
touch tail.txt
tail -f tail.txt
Opened a second terminal and entered:
seq 300 > tail.txt
All 300 entries showed up.
I did this with both busybox and GNU versions of tail.
I then upped the ante and did this:
Terminal #1
touch tail.txt
tail -f tail.txt | tee tail.mon
The results of tail get written to the screen and to tail.mon.
Terminal #1
seq 3000 > tail.txt
diff tail.txt tail.mon
All 3000 entries showed up.
The diff command showed both files were identical.
Once again, I did this with both busybox and GNU versions of tail.
-
Yup. Mine used to do the same. This week it changed and I cannot figure out why. I edited my project's source and recompiled, but that should definitely not affect how tail works. That's why I'm asking for ideas on why tail might "stall" (for lack of a better term.)
-
Hi nurbles!
How much time does it take for "tail -f" to freeze? I guess not minutes but hours?
-
The "tail" is loosing the track if file is removed and then reborn with the same name. Like
tc@box:~$ while true; do date >> abc; sleep 1; done &
in one terminal, then
tc@box tail -f abc
in another, then in the first one
tc@box:~$ jobs
[1]+ Running while true; do date 1>>abc; sleep 1; done
tc@box:~$ kill %1
tc@box:~$
[1]+ Terminated while true; do date 1>>abc; sleep 1; done
tc@box:~$ rm -f abc
tc@box:~$ while true; do date >> abc; sleep 1; done &
And "tail" in the second terminal stalls.
Isn't it Your case?
-
Hi nurbles
jazzbikers comment joggedmy memory.
When messages gets filled up it gets moved to messages.0 and
a new messages file gets created. That's probably when tail gets
hung up.
Try:
tail -F /var/log/messages
If that doesn't fix it, try:
tce-load -wi coreutils
hash -r
tail -F /var/log/messages
-
First, sorry for my delay responding...another project required my attention.
Unfortunately, the tail command stops logging for me after roughly 50-100 lines. If I hit Ctrl+C, the command prompt returns and I can re-enter my tail command. The new tail command will also stop in 50-100 lines. Repeat forever. While I understand that tail would stop following the system log when syslog switches to a new file, I cannot believe this is happening every couple hundred lines. Also, there is only /var/log/messages, no files named /var/log/messages.0 or any other suffix.
Thinking about it, what I'd really like would be to configure the syslog to also send everything to another system using UDP (e.g. by adding the line "*.* @192.168.1.1" to the config file). I need to look into that as soon as I can get back to work on this project. While the suggestions haven't solved my issue with tail -f, they have inspired a new idea, so thanks for that! (smile)
-
Hi nurbles
Maybe it's an issue with the busybox tail command.
Did you try the GNU version of tail provided by coreutils.tcz:
tce-load -wi coreutils
hash -r
tail -F /var/log/messages