Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 384151 - sys-apps/openrc autodetect lxc
Summary: sys-apps/openrc autodetect lxc
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: OpenRC Team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 387433
  Show dependency tree
 
Reported: 2011-09-23 00:41 UTC by Francesco Riosa
Modified: 2011-11-07 16:00 UTC (History)
1 user (show)

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


Attachments
/tmp/auto-lxc.patch (auto-lxc.patch,385 bytes, text/plain)
2011-09-27 15:16 UTC, William Hubbs
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Francesco Riosa 2011-09-23 00:41:21 UTC
auto-detection of subsystem type has been abandoned and rc_sys="" should be set in rc.conf if the sys is different from a normal host.

Anyway `rc -S` still output a string for some configurations, at your discretion you can add lxc to the list since there is now a way to discover it (cannot test, not using lxc here);

`grep 'container=lxc' /proc/1/environ`

From a conversation on google+ with Lennart Poettering


Lennart Poettering - Francesco, how does openrc detect lxc?
Ieri alle ore 23:40    

Francesco Riosa - +Lennart Poettering They were not able to detect it. That's one of the reason they switched to explicit rc.conf setting.
Better explained @ http://www.gentoo.org/doc/en/openrc-migration.xml (around code listing 2.15)

legacy detect code can be accessed by `/sbin/rc -S` which print out the "subsystem type" if discovered
01:25  -  Modifica   

Lennart Poettering - there's now a way to detect lxc: an env var is set which you can read from /proc/1/environ.
01:53   

Lennart Poettering - "container=lxc" is the env var
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2011-09-25 20:39:33 UTC
Diego:
IIRC you were using LXC, can you comment on this autodetect test please?
Comment 2 Diego Elio Pettenò (RETIRED) gentoo-dev 2011-09-25 20:49:05 UTC
LGTM
Comment 3 William Hubbs gentoo-dev 2011-09-27 15:16:26 UTC
Created attachment 287947 [details]
/tmp/auto-lxc.patch

Based on the description in this bug, this patch should detect lxc.

Apply the patch, then from inside a lxc container, with rc_sys not set,
run rc -S and verify that lxc is returned.
Comment 4 William Hubbs gentoo-dev 2011-11-07 16:00:47 UTC
This is added in commit f46626d.