diff --git a/init.d/fsck.in b/init.d/fsck.in
index 68cdf14..279e25c 100644
a
|
b
|
_IFS=" |
9 | 9 | depend() |
10 | 10 | { |
11 | 11 | use dev clock modules |
12 | | keyword -jail -openvz -prefix -timeout -vserver |
| 12 | keyword -jail -openvz -prefix -timeout -vserver -lxc |
13 | 13 | } |
14 | 14 | |
15 | 15 | _abort() { |
diff --git a/init.d/hwclock.in b/init.d/hwclock.in
index ea9fa34..e99900f 100644
a
|
b
|
depend() |
28 | 28 | else |
29 | 29 | before * |
30 | 30 | fi |
31 | | keyword -openvz -prefix -uml -vserver -xenu |
| 31 | keyword -openvz -prefix -uml -vserver -xenu -lxc |
32 | 32 | } |
33 | 33 | |
34 | 34 | setupopts() |
diff --git a/init.d/localmount.in b/init.d/localmount.in
index 89a4801..a4d1116 100644
a
|
b
|
depend() |
8 | 8 | { |
9 | 9 | need fsck |
10 | 10 | use lvm modules mtab |
11 | | keyword -jail -openvz -prefix -vserver |
| 11 | keyword -jail -openvz -prefix -vserver -lxc |
12 | 12 | } |
13 | 13 | |
14 | 14 | start() |
diff --git a/init.d/modules.in b/init.d/modules.in
index c2270ff..7c0b993 100644
a
|
b
|
description="Loads a user defined list of kernel modules." |
7 | 7 | depend() |
8 | 8 | { |
9 | 9 | use isapnp |
10 | | keyword -openvz -prefix -vserver |
| 10 | keyword -openvz -prefix -vserver -lxc |
11 | 11 | } |
12 | 12 | |
13 | 13 | start() |
diff --git a/init.d/mount-ro.in b/init.d/mount-ro.in
index 45e0fab..69032d7 100644
a
|
b
|
description="Re-mount filesytems read-only for a clean reboot." |
7 | 7 | depend() |
8 | 8 | { |
9 | 9 | need killprocs savecache |
10 | | keyword -prefix -openvz -vserver |
| 10 | keyword -prefix -openvz -vserver -lxc |
11 | 11 | } |
12 | 12 | |
13 | 13 | start() |
diff --git a/init.d/numlock.in b/init.d/numlock.in
index 9d88fa0..7bf3dc7 100644
a
|
b
|
ttyn=${rc_tty_number:-${RC_TTY_NUMBER:-12}} |
9 | 9 | depend() |
10 | 10 | { |
11 | 11 | need localmount |
12 | | keyword -openvz -prefix -vserver |
| 12 | keyword -openvz -prefix -vserver -lxc |
13 | 13 | } |
14 | 14 | |
15 | 15 | _setleds() |
diff --git a/init.d/procfs.in b/init.d/procfs.in
index 712adc2..2b73bd7 100644
a
|
b
|
depend() |
8 | 8 | { |
9 | 9 | use modules devfs |
10 | 10 | need localmount |
11 | | keyword -openvz -prefix -vserver |
| 11 | keyword -openvz -prefix -vserver -lxc |
12 | 12 | } |
13 | 13 | |
14 | 14 | start() |
diff --git a/init.d/root.in b/init.d/root.in
index 6dc37c8..0689060 100644
a
|
b
|
description="Mount the root fs read/write" |
7 | 7 | depend() |
8 | 8 | { |
9 | 9 | need fsck |
10 | | keyword -jail -openvz -prefix -vserver |
| 10 | keyword -jail -openvz -prefix -vserver -lxc |
11 | 11 | } |
12 | 12 | |
13 | 13 | start() |
diff --git a/init.d/swap.in b/init.d/swap.in
index 564531b..d99b9b8 100644
a
|
b
|
|
5 | 5 | depend() |
6 | 6 | { |
7 | 7 | need localmount |
8 | | keyword -jail -openvz -prefix -vserver |
| 8 | keyword -jail -openvz -prefix -vserver -lxc |
9 | 9 | } |
10 | 10 | |
11 | 11 | start() |
diff --git a/init.d/swclock.in b/init.d/swclock.in
index 2d091fe..3357fc7 100644
a
|
b
|
depend() |
8 | 8 | { |
9 | 9 | before * |
10 | 10 | provide clock |
11 | | keyword -openvz -prefix -uml -vserver -xenu |
| 11 | keyword -openvz -prefix -uml -vserver -xenu -lxc |
12 | 12 | } |
13 | 13 | |
14 | 14 | # swclock is an OpenRC built in |
diff --git a/man/runscript.8 b/man/runscript.8
index a3e1f2e..f380617 100644
a
|
b
|
When in a jail, exclude this service from any dependencies. The service can |
143 | 143 | still be run directly. |
144 | 144 | .It Dv -openvz |
145 | 145 | Same as -jail, but for OpenVZ systems. |
| 146 | .It Dv -lxc |
| 147 | Same as -jail, but for Linux Resource Containers (LXC). |
146 | 148 | .It Dv -shutdown |
147 | 149 | Don't stop this service when shutting the system down. |
148 | 150 | This normally quite safe as remaining daemons will be sent a SIGTERM just |
diff --git a/src/librc/librc.c b/src/librc/librc.c
index 96e3195..34bd9e1 100644
a
|
b
|
rc_sys(void) |
233 | 233 | return RC_SYS_VSERVER; |
234 | 234 | else if (exists("/proc/vz/veinfo") && !exists("/proc/vz/version")) |
235 | 235 | return RC_SYS_OPENVZ; |
| 236 | else if (file_regex("/proc/self/cgroup", ":/.+$")) |
| 237 | return RC_SYS_LXC; |
236 | 238 | else if (file_regex("/proc/self/status", |
237 | 239 | "envID:[[:space:]]*[1-9]")) |
238 | 240 | return RC_SYS_OPENVZ; /* old test */ |
diff --git a/src/librc/rc.h.in b/src/librc/rc.h.in
index 373f1d1..4b7977e 100644
a
|
b
|
bool rc_service_daemons_crashed(const char *); |
268 | 268 | * Some services cannot work in these systems, or we do something else. */ |
269 | 269 | #define RC_SYS_JAIL "JAIL" |
270 | 270 | #define RC_SYS_OPENVZ "OPENVZ" |
| 271 | #define RC_SYS_LXC "LXC" |
271 | 272 | #define RC_SYS_PREFIX "PREFIX" |
272 | 273 | #define RC_SYS_UML "UML" |
273 | 274 | #define RC_SYS_VSERVER "VSERVER" |