diff options
author | Diego Elio Pettenò <flameeyes@gentoo.org> | 2012-05-01 21:14:15 +0000 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@gentoo.org> | 2012-05-01 21:14:15 +0000 |
commit | 515694c8eb757ada44cb6b29aa39f9705477a54d (patch) | |
tree | 675f630129175786535152857c0f2a848eb2f867 /app-emulation/lxc | |
parent | Fix underlinking by Diego Elio Pettenò (bug #369591). (diff) | |
download | gentoo-2-515694c8eb757ada44cb6b29aa39f9705477a54d.tar.gz gentoo-2-515694c8eb757ada44cb6b29aa39f9705477a54d.tar.bz2 gentoo-2-515694c8eb757ada44cb6b29aa39f9705477a54d.zip |
Make the init.d decide whether it needs or uses the network interface depending on configuration.
(Portage version: 2.2.0_alpha101/cvs/Linux x86_64)
Diffstat (limited to 'app-emulation/lxc')
-rw-r--r-- | app-emulation/lxc/ChangeLog | 6 | ||||
-rw-r--r-- | app-emulation/lxc/files/lxc.initd.2 | 17 |
2 files changed, 20 insertions, 3 deletions
diff --git a/app-emulation/lxc/ChangeLog b/app-emulation/lxc/ChangeLog index 8c9520f72e7d..42469d1947a1 100644 --- a/app-emulation/lxc/ChangeLog +++ b/app-emulation/lxc/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for app-emulation/lxc # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/lxc/ChangeLog,v 1.36 2012/05/01 18:09:26 flameeyes Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-emulation/lxc/ChangeLog,v 1.37 2012/05/01 21:14:15 flameeyes Exp $ + + 01 May 2012; Diego E. Pettenò <flameeyes@gentoo.org> files/lxc.initd.2: + Make the init.d decide whether it needs or uses the network interface + depending on configuration. *lxc-0.8.0_rc1-r4 (01 May 2012) diff --git a/app-emulation/lxc/files/lxc.initd.2 b/app-emulation/lxc/files/lxc.initd.2 index ed0cd5c3a868..49f85bd5072c 100644 --- a/app-emulation/lxc/files/lxc.initd.2 +++ b/app-emulation/lxc/files/lxc.initd.2 @@ -1,7 +1,7 @@ #!/sbin/runscript # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/lxc/files/lxc.initd.2,v 1.2 2012/04/29 23:48:54 flameeyes Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-emulation/lxc/files/lxc.initd.2,v 1.3 2012/05/01 21:14:15 flameeyes Exp $ CONTAINER=${SVCNAME#*.} @@ -54,7 +54,20 @@ depend() { # and then require that to be enabled, so that the # dependencies are correct. netif=$(lxc_get_var lxc.network.link) - [ -n "${netif}" ] && need net.${netif} + + # when the network type is set to phys, we can make use of a + # network service (for instance to set it up before we disable + # the net_admin capability), but we might also not set it up + # at all on the host and leave the net_admin capable service + # to take care of it. + nettype=$(lxc_get_var lxc.network.type) + + if [ -n "${netif}" ]; then + case "${nettype}" in + phys) use net.${netif} ;; + *) need net.${netif} ;; + esac + fi } start() { |