Comment 5 for bug 1576692

Revision history for this message
Scott Moser (smoser) wrote :

I have a branch at https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+ref/bug/1576692 which:
a.) moves cloud-init-final to be Type=idle
b.) moves config modules such as package-update-upgrade-install to run in the final_modules

I've patched a lxc container with that, and then launched several instances. My experience is that out of 5 containers 2 or 3 of them will have a running postgres at the end (per systemctl status postgresql@9.5-main).

The user-data I'm providing is just:
 #cloud-config
 packages: [postgresql]
 runcmd:
   - "systemctl status postgresql@9.5-main > /run/my-status || true"

Then you can just look at /run/my-status.

To start a patched image what you can do is:
 n=y1
 lxc init ubuntu-daily:yakkety $n "--config=user.user-data=$(cat my.user-data)"
 lxc-chroot $n -- sh -ec 'd=/tmp/my.deb; trap "rm -f $d" EXIT; cat > $d && dpkg -i $d' < "$deb"
 lxc start $n