apt-get install lxc doesn't load required apparmor profiles
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | apparmor (Ubuntu) |
Critical
|
Unassigned | ||
| | init-system-helpers (Ubuntu) |
Medium
|
Martin Pitt | ||
| | lxc (Ubuntu) |
Medium
|
Martin Pitt | ||
| | squid3 (Ubuntu) |
Undecided
|
Unassigned | ||
| | upstart (Ubuntu) |
Medium
|
Martin Pitt | ||
Bug Description
I'm trying to use LXC on my openstack instance which runs vivid daily:
$ sudo apt-get install lxc -y
$ sudo lxc-create -t ubuntu-cloud --name=vivid -- --flush-cache --stream=daily --release=vivid
$ sudo lxc-start --name vivid --logfile=lxc.log
lxc-start: lxc_start.c: main: 344 The container failed to start.
lxc-start: lxc_start.c: main: 346 To get more details, run the container in foreground mode.
lxc-start: lxc_start.c: main: 348 Additional information can be obtained by setting the --logfile and --logpriority options.
In the log file (lxc.log) I observe the following error:
lxc-start 1426516387.814 ERROR lxc_apparmor - lsm/apparmor.
This profile *exists* under /etc/apparmor.
This issue disappears if I:
(a) reload apparmor profile manually: sudo /etc/init.
or
(b) reboot the instance
I'd expect that 'apt-get install lxc' has to load all appropriate apparmor profiles to allow starting containers w/o profile reloading / rebooting.
| description: | updated |
| Serge Hallyn (serge-hallyn) wrote : Re: [Bug 1432683] [NEW] apt-get install lxc doesn't load required apparmor profiles | #1 |
| Serge Hallyn (serge-hallyn) wrote : | #2 |
Could you please show the result of
sudo aa-status
and the contents of /tmp/debug.out after
sudo lxc-start -n vivid -l trace -o /tmp/debug.out
| Changed in lxc (Ubuntu): | |
| status: | New → Incomplete |
| Serge Hallyn (serge-hallyn) wrote : | #3 |
Oh, sorry, and 'uname -a'
| Oleg Strikov (strikov) wrote : | #4 |
Hi Serge,
Many thanks for looking at the bug.
Here is information you requested.
ubuntu@
Linux vivid-lxc-bug 3.19.0-9-generic #9-Ubuntu SMP Wed Mar 11 17:50:03 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
ubuntu@
apparmor module is loaded.
6 profiles are loaded.
6 profiles are in enforce mode.
/sbin/dhclient
/usr/
/usr/
/usr/
/usr/
/usr/
0 profiles are in complain mode.
1 processes have profiles defined.
0 processes are in enforce mode.
0 processes are in complain mode.
1 processes are unconfined but have a profile defined.
/sbin/dhclient (508)
/tmp/debug.out:
http://
| Serge Hallyn (serge-hallyn) wrote : | #5 |
Thanks. The cause of this is that /lib/init/
| Changed in lxc (Ubuntu): | |
| status: | Incomplete → Triaged |
| importance: | Undecided → Critical |
| Robie Basak (racb) wrote : | #6 |
From my grep through the archive, apparmor-
apparmor avahi cups cups-filters lxc mysql-5.6 rsyslog squid3 sssd strongswan upstart
| Robie Basak (racb) wrote : | #7 |
(source packages that is)
| Changed in apparmor (Ubuntu): | |
| importance: | Undecided → Critical |
| Changed in init-system-helpers (Ubuntu): | |
| importance: | Undecided → Critical |
| Changed in upstart (Ubuntu): | |
| importance: | Undecided → Critical |
| Serge Hallyn (serge-hallyn) wrote : | #8 |
Thanks, Robie - the only one on that list which needs an update is squid3.
| Launchpad Janitor (janitor) wrote : | #9 |
This bug was fixed in the package apparmor - 2.9.1-0ubuntu8
---------------
apparmor (2.9.1-0ubuntu8) vivid; urgency=medium
[ Steve Beattie ]
* debian/rules: run make check on the libapparmor library
* add-chromium-
(LP: #1419294)
* debian/
aa-profile-hook runs when packages are updated via snappy system
image updates (LP: #1434143)
* parser-
of audit modifiers for exec and pivot_root and deny modifiers on
link rules as well as significantly expand related tests
(LP: #1431717, LP: #1432045, LP: #1433829)
* tests-fix_
around pivot_root test failures due to init=systemd (LP: #1436109)
* GDM_X_authority
file to X abstraction (LP: #1432126)
[ Jamie Strandboge ]
* easyprof-
--include-
policy on snappy
[ Robie Basak ]
* Add /lib/apparmor/
/lib/
the original path is now provided by init-system-
-- Jamie Strandboge <email address hidden> Sat, 28 Mar 2015 07:22:30 -0500
| Changed in apparmor (Ubuntu): | |
| status: | New → Fix Released |
| Serge Hallyn (serge-hallyn) wrote : | #10 |
This is fixed for lxc through the other package uploads. lxc already depends on init-system-helpers so will need no packaging changes itself.
| Changed in lxc (Ubuntu): | |
| status: | Triaged → Fix Released |
| Launchpad Janitor (janitor) wrote : | #11 |
This bug was fixed in the package init-system-helpers - 1.22ubuntu6
---------------
init-system-helpers (1.22ubuntu6) vivid; urgency=medium
* Add /lib/init/
apparmor package and wrapped here under the old path. This name can
continue to be used by init scripts to save them individually testing if
apparmor is installed, as this wrapper performs this task.
(LP: #1432683)
-- Robie Basak <email address hidden> Thu, 02 Apr 2015 11:13:36 -0500
| Changed in init-system-helpers (Ubuntu): | |
| status: | New → Fix Released |
| Launchpad Janitor (janitor) wrote : | #12 |
This bug was fixed in the package upstart - 1.13.2-0ubuntu11
---------------
upstart (1.13.2-0ubuntu11) vivid; urgency=medium
* Remove /lib/init/
init-
to transition all current systems. (LP: #1432683)
-- Serge Hallyn <email address hidden> Thu, 02 Apr 2015 11:21:23 -0500
| Changed in upstart (Ubuntu): | |
| status: | New → Fix Released |
| Launchpad Janitor (janitor) wrote : | #13 |
This bug was fixed in the package squid3 - 3.3.8-1ubuntu14
---------------
squid3 (3.3.8-1ubuntu14) vivid; urgency=medium
* Add versioned dependency on init-system-helpers (>> 1.22ubuntu5) to ensure
we have the apparmor-
-- Serge Hallyn <email address hidden> Thu, 02 Apr 2015 11:12:27 -0500
| Changed in squid3 (Ubuntu): | |
| status: | New → Fix Released |
| Martin Pitt (pitti) wrote : | #14 |
This really doesn't belong into init-system-
| Changed in upstart (Ubuntu): | |
| status: | Fix Released → Triaged |
| Martin Pitt (pitti) wrote : | #15 |
lxc wasn't fixed for this yet -- /usr/lib/
| Changed in lxc (Ubuntu): | |
| importance: | Critical → Medium |
| status: | Fix Released → Triaged |
| Martin Pitt (pitti) wrote : | #16 |
Upstream pull request for LXC: https:/
| Changed in init-system-helpers (Ubuntu): | |
| status: | Fix Released → Triaged |
| assignee: | nobody → Martin Pitt (pitti) |
| importance: | Critical → Medium |
| Changed in lxc (Ubuntu): | |
| status: | Triaged → In Progress |
| assignee: | nobody → Martin Pitt (pitti) |
| Changed in lxc (Ubuntu): | |
| status: | In Progress → Fix Committed |
| Jens Elkner (jelmd) wrote : | #17 |
It appears, that something is still broken. Because systemd doesn't work, I installed upstart + upstart-sysv (and uninstalled systemd-sysv), but unfortunately sssd doesn't come up (has exactly the same config, as in other < 14.10 zones, where it works as expected). And because sssd doesn't come up, other depending services like autofs doesn't come up either.
The problem seems to be /lib/init/
As a workaround I modified /etc/init/
...
pre-start script
test -f /etc/sssd/sssd.conf || { stop; exit 0; }
/lib/init/
end script
...
which makes it work, however, I still wonder, what apparmor-
| Serge Hallyn (serge-hallyn) wrote : Re: [Bug 1432683] Re: apt-get install lxc doesn't load required apparmor profiles | #18 |
Does /bin/running-
If so, what does
/bin/running-
show?
| Martin Pitt (pitti) wrote : | #19 |
Wily's lxc contains the upstream MP, i. e. it calls /lib/apparmor/
| Changed in lxc (Ubuntu): | |
| status: | Fix Committed → Fix Released |
| Changed in upstart (Ubuntu): | |
| assignee: | nobody → Martin Pitt (pitti) |
| importance: | Critical → Medium |
| status: | Triaged → In Progress |
| Changed in init-system-helpers (Ubuntu): | |
| status: | Triaged → In Progress |
| Launchpad Janitor (janitor) wrote : | #20 |
This bug was fixed in the package init-system-helpers - 1.24ubuntu1
---------------
init-system-helpers (1.24ubuntu1) xenial; urgency=medium
* Merge with Debian unstable. Remaining Ubuntu changes:
- init: Drop sysvinit-core as alternative pre-depends.
- Temporarily add /bin/running-
appropriate place (LP: #1442228)
* Drop /lib/init/
upstart (LP: #1432683)
init-system-helpers (1.24) unstable; urgency=medium
[ Helmut Grohne ]
* Fix FTCBFS: Annotate perl dependency with :any. (Closes: #794339)
[ Reiner Herrmann ]
* dh_systemd_
maintainer scripts reproducible. (Closes: #801470)
-- Martin Pitt <email address hidden> Mon, 26 Oct 2015 09:06:27 +0100
| Changed in init-system-helpers (Ubuntu): | |
| status: | In Progress → Fix Released |
| Launchpad Janitor (janitor) wrote : | #21 |
This bug was fixed in the package upstart - 1.13.2-0ubuntu17
---------------
upstart (1.13.2-0ubuntu17) xenial; urgency=medium
* Put back /lib/init/
use that instead of /lib/apparmor/
-- Martin Pitt <email address hidden> Mon, 26 Oct 2015 08:59:04 +0100
| Changed in upstart (Ubuntu): | |
| status: | In Progress → Fix Released |


I couldn't reproduce this. I installed a fresh vivid vm, did apt-get install lxc,
then
ubuntu@lxc-aa:~$ sudo aa-status bin/lxc- start lib/NetworkMana ger/nm- dhcp-client. action lib/NetworkMana ger/nm- dhcp-helper lib/connman/ scripts/ dhclient- script sbin/tcpdump container- default container- default- with-mounting container- default- with-nesting
apparmor module is loaded.
9 profiles are loaded.
9 profiles are in enforce mode.
/sbin/dhclient
/usr/
/usr/
/usr/
/usr/
/usr/
lxc-
lxc-
lxc-
and
ubuntu@lxc-aa:~$ sudo lxc-create -t ubuntu-cloud --name=vivid ------- ------- ------- ------- ------- ---
[...]
ubuntu@lxc-aa:~$ sudo lxc-start -n vivid
ubuntu@lxc-aa:~$ sudo lxc-ls -f
NAME STATE IPV4 IPV6 GROUPS AUTOSTART
-------
vivid RUNNING - - - NO