Summary: | sys-apps/openrc-0.11.8 doesn't parse correctly options contained two words abreast self | ||
---|---|---|---|
Product: | Gentoo Hosted Projects | Reporter: | Marcin Mirosław <bug> |
Component: | netifrc | Assignee: | netifrc Team <netifrc> |
Status: | IN_PROGRESS --- | ||
Severity: | normal | ||
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | netifrc:DOC | ||
Package list: | Runtime testing required: | --- |
Description
Marcin Mirosław
2013-02-18 09:56:13 UTC
I believe this might be a design issue -- that is, separate, independent config options for each iface should be separated by a newline; the case where you set a static IPv4 address in between just happens to make it work by coincidence. Please try: dhcp_giga="nontp" config_giga="dhcp apipa" ..and see if this works as expected. Yes, as axs notes, they must be seperated by newlines. Multiple IPs on a single line works for reasons of BL1 compatibility only. Back in BL1 it was a bash array, and multiple IPs in a single array element 0 were supported for old systems. We do still parse bash arrays if bash is used, but display warnings telling users to migrate. We should consider removing the array support, as it's been deprecated for years now. In the meantime, I welcome you to suggest how we can improve the documentation net.example. As Ian said, if every option is in new line then openrc configures network as I expect.
Robin, you said:
> We do still parse bash arrays if bash is used, but display warnings telling users to migrate
Warning isn't displayed in all cases:
# /etc/init.d/net.giga -D restart
net.giga | * Bringing down interface giga
net.giga | * Stopping udhcpc on giga ... [ ok ]
net.giga | * Bringing up interface giga
net.giga | * 1.2.3.4/24 ... [ ok ]
net.giga | * 2.3.4.5/24 ... [ ok ]
# grep giga /etc/conf.d/net
dhcp_giga="nontp"
config_giga="1.2.3.4/24 2.3.4.5/24"
# /etc/init.d/net.giga -D restart
net.giga | * Bringing down interface giga
net.giga | * Bringing up interface giga
net.giga | * You are using a bash array for config_giga.
net.giga | * This feature will be removed in the future.
net.giga | * Please see net.example for the correct format for config_giga.
net.giga | * 1.2.3.4/24 ... [ ok ]
net.giga | * 2.3.4.5/24 ... [ ok ]
# grep giga /etc/conf.d/net
dhcp_giga="nontp"
config_giga=( "1.2.3.4/24 2.3.4.5/24" )
If you are going to remove support for bash arrays please add warning about configuration without parentheses and give some time.
In net.example I can see:
# You can also use IPv6 addresses
# (you should always specify a prefix length with IPv6 here)
#config_eth0="192.168.0.2/24 4321:0:1:2:3:4:567:89ab/64 4321:0:1:2:3:4:567:89ac/64"
[...]
#config_eth0="noop 192.168.0.2/24"
So there is many examples that can suggests using multiple options in one line. Please consider to keep support for arrays for sometime:))
About improving documentation, you mean preparing patch or writing information about what places in doc should be reviewed?
(In reply to Marcin Mirosław from comment #3) > Warning isn't displayed in all cases: > # grep giga /etc/conf.d/net > dhcp_giga="nontp" > config_giga="1.2.3.4/24 2.3.4.5/24" This isn't using arrays. > Please consider to keep support for arrays for sometime:)) As far as I know there are no plans to drop or remove arrays support -- the issue with it is that it's a bashism, and netifrc doesn't depend on bash but rather POSIX sh and so we can't *officially* support arrays in conf.d/net. > About improving documentation, you mean preparing patch or writing > information about what places in doc should be reviewed? Yep. Anywhere in net.example (or any other docs) that is putting multiple independent config options on the same line in config_*, should be flagged and/or adjusted. Patches welcome! (In reply to Ian Stakenvicius from comment #4) > (In reply to Marcin Mirosław from comment #3) > > Please consider to keep support for arrays for sometime:)) > > As far as I know there are no plans to drop or remove arrays support ..correction, I guess robbat2 is suggesting it's removal. I'll read better before posting next time. (In reply to Ian Stakenvicius from comment #4) > (In reply to Marcin Mirosław from comment #3) > > Warning isn't displayed in all cases: > > # grep giga /etc/conf.d/net > > dhcp_giga="nontp" > > config_giga="1.2.3.4/24 2.3.4.5/24" > > This isn't using arrays. Ian is correct; this is not using an array so it will not trigger the warning. An array would have () instead of quotes. > > > Please consider to keep support for arrays for sometime:)) Array support has been around, with a warning about deprecation, for years, so I don't see a need to keep it around for more years. > > About improving documentation, you mean preparing patch or writing > > information about what places in doc should be reviewed? > > Yep. Anywhere in net.example (or any other docs) that is putting multiple > independent config options on the same line in config_*, should be flagged > and/or adjusted. Patches welcome! I think net.example is probably going to be the main source of this. |