Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 349389 - >sys-apps/openrc-0.5.2: rc detects RHEL6 OpenVZ Host as LXC container
Summary: >sys-apps/openrc-0.5.2: rc detects RHEL6 OpenVZ Host as LXC container
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: OpenRC Team
URL:
Whiteboard: openrc:rc_sys
Keywords:
Depends on:
Blocks: 295613
  Show dependency tree
 
Reported: 2010-12-22 16:20 UTC by Oliver Schmidt
Modified: 2011-01-06 06:29 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Fixes an issue with RHEL6 OpenVZ kernel being detected as LXC Container (lxc-openvz-detection.patch,606 bytes, patch)
2010-12-22 16:21 UTC, Oliver Schmidt
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Schmidt 2010-12-22 16:20:34 UTC
This is related to http://bugs.gentoo.org/show_bug.cgi?id=291364

My patch fixes an issue I have found while testing the new OpenVZ RHEL6
kernel on a machine with OpenRC 0.6.8 on it. 

Problem: new OpenVZ code uses cgroups now, too (as LXC does). rc detects host
as LXC container as /proc/self/cgroup has content matching the regex in test
(inside of librc.c system detection code). Host machine does not boot correctly
as some services are not started because of false LXC detection.

Solution: the patch adds some conditions to the LXC check. This is a quick fix,
as it only looks out for some typical OpenVZ files inside /proc.

Remaining issues: It would be a more appropriate solution, if the LXC check
would be more LXC specific and not just a quick look into /proc/self/cgroup.
Perhaps someone with more LXC experience has a good hint for this?


Reproducible: Always

Steps to Reproduce:
1. Install OpenVZ RHEL6 Kernel
2. Boot into kernel on machine with OpenRC as init System

Actual Results:  
rc -S show LXC -> system is detected as LXC container and the boot process is not done right (no root/localmount/... service started as specified in OpenRC for LXC-container)

Expected Results:  
Boot correctly this host machine...
Comment 1 Oliver Schmidt 2010-12-22 16:21:13 UTC
Created attachment 257770 [details, diff]
Fixes an issue with RHEL6 OpenVZ kernel being detected as LXC Container
Comment 2 Duncan 2011-01-06 00:49:22 UTC
Also related to bug #347583 (task groups cgroups confused with LXC).  If the /manual/ keyword setting solution under discussion there is implemented, this bug will be fixed as well.  Conversely, the patch suggested here could fix that one too.  So in addition to both bugs blocking bug #295613 (openrc stabilization tracker), perhaps one should depend on or dup the other?
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2011-01-06 06:29:26 UTC
Fixed in Git as of 3d4d1ab1.
Please test the 9999 ebuild.