Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 381806 Details for
Bug 518484
app-emulation/lxc - files/lxc.initd.2 should `use net'
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
my solution
lxc.initd.2.diff (text/plain), 1.88 KB, created by
mike
on 2014-07-29 12:48:58 UTC
(
hide
)
Description:
my solution
Filename:
MIME Type:
Creator:
mike
Created:
2014-07-29 12:48:58 UTC
Size:
1.88 KB
patch
obsolete
>diff --git a/app-emulation/lxc/files/lxc.initd.2 b/app-emulation/lxc/files/lxc.initd.2 >index 72680d8..9e5debd 100644 >--- a/app-emulation/lxc/files/lxc.initd.2 >+++ b/app-emulation/lxc/files/lxc.initd.2 >@@ -24,6 +24,16 @@ lxc_get_var() { > awk 'BEGIN { FS="[ \t]*=[ \t]*" } $1 == "'$1'" { print $2; exit }' ${CONFIGFILE} > } > >+lxc_get_net_link_type() { >+ awk 'BEGIN { FS="[ \t]*=[ \t]*"; _link=""; _type="" } >+ $1 == "lxc.network.type" {_type=$2;} >+ $1 == "lxc.network.link" {_link=$2;} >+ {if(_link != "" && _type != ""){ >+ printf("%s:%s\n", _link, _type ); >+ _link=""; _type=""; >+ }; }' <${CONFIGFILE} >+} >+ > checkconfig() { > if [ ${CONTAINER} = ${SVCNAME} ]; then > eerror "You have to create an init script for each container:" >@@ -50,24 +60,19 @@ depend() { > config ${CONFIGFILE} > need localmount > >- # find out which network interface the container is linked to, >- # and then require that to be enabled, so that the >- # dependencies are correct. >- netif=$(lxc_get_var lxc.network.link) >- >- # 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 >+ local _x _if >+ for _x in $(lxc_get_net_link_type); do >+ _if=${_x%:*} >+ case "${_x##*:}" in >+ # 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. >+ phys) use net.${_if} ;; >+ *) need net.${_if} ;; >+ esac >+ done > } > > start() {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 518484
: 381806