[Lxc-users] Ubuntu template questions

Papp Tamas tompos at martos.bme.hu
Thu Mar 8 08:27:15 UTC 2012


hi All,

I always created an own template with debootstrap and I used it.

Now I tried lxc-create -t ubuntu and I still have some question and 
suggestion:

1. I suggest ntpdate not to be installed (remove after debootstrap). 
Also I think 'update-rc.d -f ondemand remove' would be fine in the 
container. Actually I see this somewhere in the script, but I had to do 
it manually.
2. It would be nice, if a postinstall script can be called automatically
3. I think rootfs.hold file should be documented better, for example 
with a text message in it.
4. I always wanted to ask, why lxc-create command has a switch '-n' if 
it defined in the configuration anyway?
5. There are a number of custom devices, which I think by default should 
not be there. For example tun and others. Or are they necessary? Is this 
just a kind of failsafe solution for the beginning/beginners which needs 
to be tuned?
6. How can I deploy it to a custom directory? With the switch '-B' I was 
not successful. Anyway, many times I just want to create a container 
with no individual partition (volume). Now I copied it from /var/lib/lxc.
7. Why does lxc-destroy remove the container files without asking about 
it? I think is a bad idea.
8. The script creates some custom upstart config file:
lxc.conf: Why don't use lxcguest package?
ssh.conf: why is this necessary?
console.conf: It should be in the package upstart as tty[0-6].conf or in 
lxcguest package, isn't it?

9. The script just removes config files instead of using dpkg-divert:
rm -f $rootfs/etc/init/tty{5,6}.conf

chroot $rootfs /bin/bash -c 'cd /etc/init; for f in $(ls u*.conf); do mv 
$f $f.orig; done'
chroot $rootfs /bin/bash -c 'cd /etc/init; for f in $(ls tty[2-9].conf); 
do mv $f $f.orig; done'
chroot $rootfs /bin/bash -c 'cd /etc/init; for f in $(ls 
plymouth*.conf); do mv $f $f.orig; done'
chroot $rootfs /bin/bash -c 'cd /etc/init; for f in $(ls hwclock*.conf); 
do mv $f $f.orig; done'
chroot $rootfs /bin/bash -c 'cd /etc/init; for f in $(ls module*.conf); 
do mv $f $f.orig; done'


Why?

10.
if [ $release != "lucid" ]; then
     sed -i 's/^.*emission handled.*$/echo Emitting lo/' 
$rootfs/etc/network/if-up.d/upstart
fi
         * Would not be better if there is an lxclo.conf from lxcguest? 
Than you don't need to worry about package updates.




Anyway, nice work guys. Thank you!

tamas




More information about the lxc-users mailing list