为什么`tail -f`在运行时不会关注我的syslog?

我希望实时监控/var/log/syslog中的任何变化(或几秒钟内),但tail -f不会随着任何新的更改而更新。

我现在正在运行基于Ubuntu的Linux Mint 17 XFCE,但这对于Ubuntu,Xubuntu或Linux Mint Mate的live iso也没有用。

我试过这些:

$ tail -f /var/log/syslog
$ tail -f --retry -s 1 /var/log/syslog
$ tail --follow=name /var/log/syslog
$ tail --follow=name --retry /var/log/syslog
$ tail --follow=name --retry -s 1 /var/log/syslog

但它最初只输出文件的最后几行,然后在文件增长时没有更新(例如,当尝试挂载空文件时会产生大约15行错误)。

实际上,即使尝试跟踪我的主文件夹中的测试文件似乎也不起作用,运行tail -f testfile然后(在另一个终端中):
$ echo "new stuff" >> testfile
$ echo "new stuff2" >> testfile
$ echo "3" >> testfile
不会导致任何tail更新……
但是,如果我将testfile放在/tmp (安装在tmpfs上),那么它跟踪文件的更改。

为什么不跟随尾巴?

有关运行直播的事情,或者覆盖tail -f overlayfs有什么奇怪吗? 以及如何遵循日志的任何建议? ( xwatch工作正常,有什么更好的还是在终端?)


我已经尝试运行strace tail -f -s 1 testfile ,这里是最后几行输出,在write(1,是现有的几行testfile

 write(1, "new1\n", 5new1 ) = 5 fstat64(3, {st_mode=S_IFREG|0644, st_size=22, ...}) = 0 fstatfs64(3, 84, {f_type=0x1021994, f_bsize=4096, f_blocks=968776, f_bfree=461437, f_bavail=461437, f_files=203469, f_ffree=190635, f_fsid={0, 0}, f_namelen=255, f_frsize=4096, f_flags=1056}) = 0 inotify_init() = 4 inotify_add_watch(4, "testfile", IN_MODIFY|IN_ATTRIB|IN_DELETE_SELF|IN_MOVE_SELF) = 1 fstat64(3, {st_mode=S_IFREG|0644, st_size=22, ...}) = 0 read(4, 

tail使用无法与overlayfs一起使用的inotify请参阅此错误报告和此讨论 。 @ Xen2050指出---disable-inotify切换到tail看到这个解决方法

您可以使用apt-src来安装coreutils源,并使用-UHAVE_INOTIFY重新编译tail