[lxc-devel] Bug? Watching of /run/utmp

Tobias Gruetzmacher tobias-lists at 23.gs
Sun Jun 16 14:50:52 UTC 2013


Hi,

in src/lxc/lxcutmp.c in function lxc_utmp_mainloop_add, lxc tries to set 
up an inotify watch for /run or /var/run - but only, if I understand the 
check correctly, if /run/utmp or /var/run exist in the container.

Since I mount /run as a tmpfs in the container, this check was never true 
and the inotify watch seems to target /var/run (which is a symlink) and 
never properly picked up utmp. In the end, this prevented containers to 
shutdown properly (only init left, but lxc doesn't kill it). My current 
workaround is a lxc.hook.mount script, which does

  touch "$LXC_ROTFS_MOUNT/run/utmp"

after mounting the tmpfs on /run.

IMHO, the check for path2 (starting at line 315 in lxcutemp.c) should be 
removed.

Greetings, Tobias

-- 
GPG-Key 0xE2BEA341 - signed/encrypted mail preferred





More information about the lxc-devel mailing list