[Lxc-users] tail -f (inotify) not working in container?

Serge Hallyn serge.hallyn at ubuntu.com
Wed Feb 27 14:12:43 UTC 2013


Quoting Papp Tamas (tompos at martos.bme.hu):
> On 02/26/2013 07:36 PM, Dan Kegel wrote:
> >
> > Oddly, tail -f doesn't seem to be working properly inside my container.
> > It displays ten lines, and then sits forever.  ^C and running it again
> > shows a more up to date ten lines, but then sits forever.
> >
> > strace shows:
> > ...
> > inotify_init()                          = 4
> > inotify_add_watch(4, "err.log",
> > IN_MODIFY|IN_ATTRIB|IN_DELETE_SELF|IN_MOVE_SELF) = 1
> > fstat(3, {st_mode=S_IFREG|0664, st_size=380103, ...}) = 0
> > read(4,
> >
> > This is ubuntu 12.04.1.
> >
> > Anyone run into this before?  I see a few lxc/inotify problem reports,
> > but nothing that seems related.
> 
> 
> I had a very little bit similar problem. There was a message:
> 
> tail: inotify cannot be used, reverting to polling: Too many open files
> 
> And actually it worked.
> 
> I increased the value of /proc/sys/fs/inotify/max_user_watches.
> You may have similar issue.

Right - or you may have a kernel bug...  fwiw inotify does work for me
in containers.

-serge




More information about the lxc-users mailing list