Bug 45175

Summary: systemd does not detect libvirt LXC containers
Product: systemd Reporter: Jan Rękorajski <baggins>
Component: generalAssignee: Lennart Poettering <lennart>
Status: RESOLVED NOTOURBUG QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Detect libvirt LXC

Description Jan Rękorajski 2012-01-24 05:29:36 UTC
Created attachment 56074 [details] [review]
Detect libvirt LXC

detect_container function expects "/proc/1/environ" to contain a line starting with "container=lxc", which is not there if container is run from libvirt.
The solution is to check for LIBVIRT_LXC_ anvironment variables, which attached patch does.
Comment 1 Lennart Poettering 2012-01-24 10:51:18 UTC
libvirt upstream has agreed to set container=lxc now, too, and I think that's the better place to fix it. Hence, closing.
Comment 2 Eric Blake 2012-01-24 11:08:08 UTC
The libvirt fix won't be present until libvirt 0.9.10; you can track it here:
https://www.redhat.com/archives/libvir-list/2012-January/msg00973.html
Comment 3 Lennart Poettering 2012-01-24 11:20:19 UTC
Or actually, upstream decided to go for container=lxc-libvirt, which is even nicer.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.