[lxc-devel] solved: issue with cgroups on very first start of any container after bootstrapping the host

Jäkel, Guido G.Jaekel at dnb.de
Thu Jun 21 15:57:48 UTC 2012


>>       lxc-start 1340194612.798 ERROR    lxc_conf - No such file or directory - failed to mount '/cgroup/testcat0' on
>'/usr/lib/lxc/rootfs/cgroup'  <<-- SHOULD BE /cgroup/lxc/testcat0  HERE ???
>
>How are you asking for this mount to happen?  Can you give your container
>config file?


Hi Serge,

Thank you for your question, it point me to the core! 


I thought it was a lxc internal problem, but it was caused *completely* by my own. I have copied a snippet from other lxc scripts to deal with the old and new cgroup style to a container. And unlike all other usage, in the start script I did a evaluation of this before a container is running. And for before the first start, there is no lxc directory even with the newer lxc.  :o


>From a construct like

	CGROUPPATH="/cgroup"    # our default
	[ -d "$CGROUPPATH/lxc" ] && CGROUPPATH+="/lxc"        # for newer lxc

and using the option 

	-s lxc.mount.entry=$CGROUPPATH/$CONTAINER cgroup none ro,bind 0 0

for lxc-start, the script have calculated a wrong dynamic mount for the containers cgroup view. I use this to support some tools like a lxc-aware replacement for 'free'. 



I just have to setup a better test based on  lxc-version, i.e.

	REQUIRELXCVERSION () { # $1: Version
	 [[ ! "`lxc-version | sed 's#.*: ##g'`" < "$1" ]]       # i.e. >=
	}

	REQUIRELXCVERSION 0.8 && CGROUPPATH+="/lxc"     # for newer lxc



Sorry to all

Guido




More information about the lxc-devel mailing list