When ceilometer charm tries to install dependencies for ceilometer, on systemd distros (xenial and above), this happens:
unit-ceilometer-0[1764]: 2017-01-15 13:17:47 INFO unit.ceilometer/0.install logger.go:40 dpkg-query: package 'python-apt' is not installed and no information is available
unit-ceilometer-0[1764]: 2017-01-15 13:17:47 INFO unit.ceilometer/0.install logger.go:40 Use dpkg --info (= dpkg-deb --info) to examine archive files,
unit-ceilometer-0[1764]: 2017-01-15 13:17:47 INFO unit.ceilometer/0.install logger.go:40 and dpkg --contents (= dpkg-deb --contents) to list their contents.
unit-ceilometer-0[1764]: 2017-01-15 13:17:47 INFO unit.ceilometer/0.install logger.go:40 E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
unit-ceilometer-0[1764]: 2017-01-15 13:17:47 INFO unit.ceilometer/0.install logger.go:40 E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
unit-ceilometer-0[1764]: 2017-01-15 13:17:47 INFO unit.ceilometer/0.install logger.go:40 dpkg-query: package 'python-netaddr' is not installed and no information is available
unit-ceilometer-0[1764]: 2017-01-15 13:17:47 INFO unit.ceilometer/0.install logger.go:40 Use dpkg --info (= dpkg-deb --info) to examine archive files,
unit-ceilometer-0[1764]: 2017-01-15 13:17:47 INFO unit.ceilometer/0.install logger.go:40 and dpkg --contents (= dpkg-deb --contents) to list their contents.
unit-ceilometer-0[1764]: 2017-01-15 13:17:47 INFO unit.ceilometer/0.install logger.go:40 E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
unit-ceilometer-0[1764]: 2017-01-15 13:17:47 INFO unit.ceilometer/0.install logger.go:40 E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
unit-ceilometer-0[1764]: 2017-01-15 13:17:47 INFO unit.ceilometer/0.install logger.go:40 dpkg-query: package 'python-netifaces' is not installed and no information is available
unit-ceilometer-0[1764]: 2017-01-15 13:17:47 INFO unit.ceilometer/0.install logger.go:40 Use dpkg --info (= dpkg-deb --info) to examine archive files,
unit-ceilometer-0[1764]: 2017-01-15 13:17:47 INFO unit.ceilometer/0.install logger.go:40 and dpkg --contents (= dpkg-deb --contents) to list their contents.
unit-ceilometer-0[1764]: 2017-01-15 13:17:47 INFO unit.ceilometer/0.install logger.go:40 E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
unit-ceilometer-0[1764]: 2017-01-15 13:17:47 INFO unit.ceilometer/0.install logger.go:40 E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
unit-ceilometer-0[1764]: 2017-01-15 13:17:47 INFO unit.ceilometer/0.install logger.go:40 dpkg-query: package 'python-pip' is not installed and no information is available
unit-ceilometer-0[1764]: 2017-01-15 13:17:47 INFO unit.ceilometer/0.install logger.go:40 Use dpkg --info (= dpkg-deb --info) to examine archive files,
unit-ceilometer-0[1764]: 2017-01-15 13:17:47 INFO unit.ceilometer/0.install logger.go:40 and dpkg --contents (= dpkg-deb --contents) to list their contents.
unit-ceilometer-0[1764]: 2017-01-15 13:17:47 INFO unit.ceilometer/0.install logger.go:40 E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
unit-ceilometer-0[1764]: 2017-01-15 13:17:47 INFO unit.ceilometer/0.install logger.go:40 E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
unit-ceilometer-0[1764]: 2017-01-15 13:17:47 INFO unit.ceilometer/0.install logger.go:40 dpkg-query: package 'python-yaml' is not installed and no information is available
unit-ceilometer-0[1764]: 2017-01-15 13:17:47 INFO unit.ceilometer/0.install logger.go:40 Use dpkg --info (= dpkg-deb --info) to examine archive files,
unit-ceilometer-0[1764]: 2017-01-15 13:17:47 INFO unit.ceilometer/0.install logger.go:40 and dpkg --contents (= dpkg-deb --contents) to list their contents.
unit-ceilometer-0[1764]: 2017-01-15 13:17:47 INFO unit.ceilometer/0.install logger.go:40 E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
unit-ceilometer-0[1764]: 2017-01-15 13:17:47 INFO unit.ceilometer/0.install logger.go:40 E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
unit-ceilometer-0[1764]: 2017-01-15 13:17:47 INFO unit.ceilometer/0.install logger.go:40 /var/lib/juju/agents/unit-ceilometer-0/charm/hooks/install: /var/lib/juju/agents/unit-ceilometer-0/charm/hooks/install.real: /usr/bin/python: bad interpreter: No such file or directory
unit-ceilometer-0[1764]: 2017-01-15 13:17:47 INFO unit.ceilometer/0.install logger.go:40 /var/lib/juju/agents/unit-ceilometer-0/charm/hooks/install: line 20: /var/lib/juju/agents/unit-ceilometer-0/charm/hooks/install.real: Success
unit-ceilometer-0[1764]: 2017-01-15 13:17:47 ERROR juju.worker.uniter.operation runhook.go:107 hook "install" failed: exit status 126
This is due to systemd blocking apt right after the container start, due to systemd initialization.
Fix should be implemented similar to this manner:
http://bazaar.launchpad.net/~mariosplivalo/charms/trusty/mongodb/lp1513094/revision/97
Fix proposed to branch: master /review. openstack. org/420639
Review: https:/