[pkg-lxc-devel] Bug#905869: lxc-create fails creating ubuntu-bionic containers on stable/stretch
Karl Goetz
karl at kgoetz.id.au
Fri Aug 10 23:20:36 BST 2018
Package: lxc
Version: 1:2.0.7-2+deb9u2
Required setup:
* Stable install (Stretch)
* LXC 1:2.0.7-2+deb9u2
* Debootstrap 1.0.89
* Ubuntu Bionic debootstrap script
> root at mainserver:/usr/share/debootstrap/scripts# ls -lh $PWD/bionic
> lrwxrwxrwx 1 root root 5 Aug 10 11:25 /usr/share/debootstrap/scripts/bionic -> gutsy
When trying to bootstrap a new Ubuntu Bionic container the lxc-ubuntu
template fails to move a file that looks suspiciously like an upstart
config file (which is no longer used in Ubuntu)
> root at mainserver:/var/log/lxc# /usr/bin/lxc-create --name tendenci11-combined --template ubuntu --bdev dir --logfile /var/log/lxc/lxc-tendenci11-combined.log --logpriority INFO -- --release bionic
> lxc-create: lxccontainer.c: lxc_container_new: 4151 Error: tendenci11-combined creation was not completed
> Checking cache download in /var/cache/lxc/bionic/rootfs-amd64 ...
> Copy /var/cache/lxc/bionic/rootfs-amd64 to /var/lib/lxc/tendenci11-combined/rootfs ...
> Copying rootfs to /var/lib/lxc/tendenci11-combined/rootfs ...
> Generating locales (this might take a while)...
> en_AU.UTF-8... done
> Generation complete.
> mv: cannot stat '/var/lib/lxc/tendenci11-combined/rootfs/etc/init/ssh.conf': No such file or directory
> lxc-create: lxccontainer.c: create_run_template: 1297 container creation template for tendenci11-combined failed
> lxc-create: tools/lxc_create.c: main: 318 Error creating container tendenci11-combined
Guarding the file moves with if statements works for me allowing me to
deploy Bionic hosts:
root at mainserver:/usr/share/lxc/templates# diff -ruNa lxc-ubuntu{-backup,}
--- lxc-ubuntu-backup 2018-08-10 11:41:25.920662559 +0000
+++ lxc-ubuntu 2018-08-10 11:42:18.865713548 +0000
@@ -153,9 +153,9 @@
chmod +x $rootfs/usr/sbin/policy-rc.d
rm -f $rootfs/etc/ssh/ssh_host_*key*
- mv $rootfs/etc/init/ssh.conf $rootfs/etc/init/ssh.conf.disabled
+ if [ -x $rootfs/etc/init/ssh.conf ]; then mv
$rootfs/etc/init/ssh.conf $rootfs/etc/init/ssh.conf.disabled; fi
DPKG_MAINTSCRIPT_PACKAGE=openssh DPKG_MAINTSCRIPT_NAME=postinst
chroot $rootfs /var/lib/dpkg/info/openssh-server.postinst configure
- mv $rootfs/etc/init/ssh.conf.disabled $rootfs/etc/init/ssh.conf
+ if [ -x $rootfs/etc/init/ssh.conf.disabled ]; then mv
$rootfs/etc/init/ssh.conf.disabled $rootfs/etc/init/ssh.conf; fi
sed -i "s/root@$(hostname)/root@$hostname/g"
$rootfs/etc/ssh/ssh_host_*.pub
Would be good to see a fix (that or something from upstream) so we can
deploy future OS' on stable.
thanks,
Karl.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 899 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-lxc-devel/attachments/20180811/03aefbf9/attachment.sig>
More information about the Pkg-lxc-devel
mailing list