1 |
flameeyes 12/05/01 21:14:15 |
2 |
|
3 |
Modified: lxc.initd.2 |
4 |
Log: |
5 |
Make the init.d decide whether it needs or uses the network interface depending on configuration. |
6 |
|
7 |
(Portage version: 2.2.0_alpha101/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.3 app-emulation/lxc/files/lxc.initd.2 |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/lxc/files/lxc.initd.2?rev=1.3&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/lxc/files/lxc.initd.2?rev=1.3&content-type=text/plain |
14 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/lxc/files/lxc.initd.2?r1=1.2&r2=1.3 |
15 |
|
16 |
Index: lxc.initd.2 |
17 |
=================================================================== |
18 |
RCS file: /var/cvsroot/gentoo-x86/app-emulation/lxc/files/lxc.initd.2,v |
19 |
retrieving revision 1.2 |
20 |
retrieving revision 1.3 |
21 |
diff -u -r1.2 -r1.3 |
22 |
--- lxc.initd.2 29 Apr 2012 23:48:54 -0000 1.2 |
23 |
+++ lxc.initd.2 1 May 2012 21:14:15 -0000 1.3 |
24 |
@@ -1,7 +1,7 @@ |
25 |
#!/sbin/runscript |
26 |
# Copyright 1999-2012 Gentoo Foundation |
27 |
# Distributed under the terms of the GNU General Public License v2 |
28 |
-# $Header: /var/cvsroot/gentoo-x86/app-emulation/lxc/files/lxc.initd.2,v 1.2 2012/04/29 23:48:54 flameeyes Exp $ |
29 |
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/lxc/files/lxc.initd.2,v 1.3 2012/05/01 21:14:15 flameeyes Exp $ |
30 |
|
31 |
CONTAINER=${SVCNAME#*.} |
32 |
|
33 |
@@ -54,7 +54,20 @@ |
34 |
# and then require that to be enabled, so that the |
35 |
# dependencies are correct. |
36 |
netif=$(lxc_get_var lxc.network.link) |
37 |
- [ -n "${netif}" ] && need net.${netif} |
38 |
+ |
39 |
+ # when the network type is set to phys, we can make use of a |
40 |
+ # network service (for instance to set it up before we disable |
41 |
+ # the net_admin capability), but we might also not set it up |
42 |
+ # at all on the host and leave the net_admin capable service |
43 |
+ # to take care of it. |
44 |
+ nettype=$(lxc_get_var lxc.network.type) |
45 |
+ |
46 |
+ if [ -n "${netif}" ]; then |
47 |
+ case "${nettype}" in |
48 |
+ phys) use net.${netif} ;; |
49 |
+ *) need net.${netif} ;; |
50 |
+ esac |
51 |
+ fi |
52 |
} |
53 |
|
54 |
start() { |