Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 483034 - sys-apps/openrc-0.11.8 fails to configure IP on wi-fi interface with SSID contains '-'
Summary: sys-apps/openrc-0.11.8 fails to configure IP on wi-fi interface with SSID con...
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: OpenRC Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-30 16:51 UTC by Sergey S. Starikoff
Modified: 2013-09-02 16:47 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey S. Starikoff 2013-08-30 16:51:55 UTC
Not long ago I've changed internet provider.
Initial configurated by provider's specialists router SSID contained '-' symbol (myopname-8).

/etc/wpa_supplicant/wpa_supplicant.conf 
# allow frontend (e.g., wpa_cli) to be used by all users in 'wheel' group
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
#
# home network; allow all valid ciphers
network={
         ssid="myopname-8"
         scan_ssid=1
         key_mgmt=WPA-PSK
         psk="0101010101010101010101010101010101"
        }
#

# grep -v ^# /etc/conf.d/net
config_nic0="null"
dhcp_nic0="release nodns nontp nonis nosendhost"
wpa_supplicant_nic0="-Dwext"
associate_timeout_nic0=32
config_myopname-8="dhcp"

Auto-start (similiarly to restart) showes the following error:
# /etc/init.d/net.nic0 restart
 * Caching service dependencies ...
/etc/init.d/../conf.d/net: line 11: config_mgts-6=dhcp: command not found
/etc/init.d/../conf.d/net: line 11: config_mgts-6=dhcp: command not found
 * Stopping named ...                                                                                        [ ok ]
/etc/init.d/../conf.d/net: line 11: config_mgts-6=dhcp: command not found
 * Bringing down interface nic0
 *   Stopping dhcpcd on nic0 ...                                                                             [ ok ]
 *   Removing addresses
 *     Stopping wpa_cli on nic0 ...                                                                          [ ok ]
 *     Stopping wpa_supplicant on nic0 ...                                                                   [ ok ]
/etc/init.d/../conf.d/net: line 11: config_mgts-6=dhcp: command not found
 * Bringing up interface nic0
 *   Starting wpa_supplicant on nic0 ...                                                                     [ ok ]
 *   Starting wpa_cli on nic0 ...                                                                            [ ok ]
 *   Backgrounding ... ...
 * WARNING: net.nic0 has started, but is inactive
 * WARNING: named is scheduled to started when net.nic0 has started


Logs shows, that physical channel is configured, but not IP:

# ifconfig nic0
nic0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::2e0:61ff:fe35:8550  prefixlen 64  scopeid 0x20<link>
        ether 00:e0:61:35:85:50  txqueuelen 1000  (Ethernet)
        RX packets 402  bytes 101850 (99.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 417  bytes 142396 (139.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


Direct executing of dhcpcd configures the interface:

# dhcpcd nic0
dhcpcd[5553]: version 5.6.4 starting
dhcpcd[5553]: nic0: sending IPv6 Router Solicitation
dhcpcd[5553]: nic0: broadcasting for a lease
dhcpcd[5553]: nic0: Router Advertisement from fe80::1
dhcpcd[5553]: nic0: did not fork due to an absent RDNSS option in the RA
dhcpcd[5553]: nic0: no support for DHCPv6 management
dhcpcd[5553]: nic0: offered 192.168.100.3 from 192.168.100.1
dhcpcd[5553]: nic0: acknowledged 192.168.100.3 from 192.168.100.1
dhcpcd[5553]: nic0: checking for 192.168.100.3
dhcpcd[5553]: nic0: leased 192.168.100.3 for 259200 seconds
dhcpcd[5553]: forked to background, child pid 5607

# ifconfig nic0
nic0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.100.3  netmask 255.255.255.0  broadcast 192.168.100.255
        inet6 fe80::2e0:61ff:fe35:8550  prefixlen 64  scopeid 0x20<link>
        ether 00:e0:61:35:85:50  txqueuelen 1000  (Ethernet)
        RX packets 437  bytes 108848 (106.2 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 468  bytes 161453 (157.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


But I expect it to be done by openrc on boot time.
Comment 1 Ian Stakenvicius (RETIRED) gentoo-dev 2013-08-30 17:00:20 UTC
I'm a bit confused here by what you posted -- your conf.d/net shows:

config_myopname-8="dhcp"

..but the scripts are erroring out on:

config_mgts-6=dhcp

If this is just a different name you set in conf.d/net for testing (instead of myopname-8), please let us know, otherwise there seems to definitely be a bigger issue.

As a bit of advice, though, I would recommend using '_' instead of '-' in the name of the config var;  This is akin to the differences between ${IFACE} and ${IFVAR} that you can read about at the bottom of net.example
Comment 2 Sergey S. Starikoff 2013-08-30 18:03:42 UTC
(In reply to Ian Stakenvicius from comment #1)
> I'm a bit confused here by what you posted -- your conf.d/net shows:

Ops, excuse me.
First time I've cleared private data from published configs, but missed similiar filter on output data.

The correct (according to configs) is:
"config_myopname-8=dhcp: command not found"
Comment 3 William Hubbs gentoo-dev 2013-08-30 18:45:30 UTC
(In reply to Sergey S. Starikoff from comment #2)
> (In reply to Ian Stakenvicius from comment #1)
> > I'm a bit confused here by what you posted -- your conf.d/net shows:
> 
> Ops, excuse me.
> First time I've cleared private data from published configs, but missed
> similiar filter on output data.
> 
> The correct (according to configs) is:
> "config_myopname-8=dhcp: command not found"

As stated above, replace this line in /etc/conf.d/net:

config_myopname-8="dhcp"

with this:

config_myopname_8="dhcp"

This is a shell limitation; "-" is not allowed in variable names and must be replaced with "_".

After you do this report back to the bug and let us know if the issue is fixed.
Comment 4 Sergey S. Starikoff 2013-09-02 10:14:55 UTC
(In reply to William Hubbs from comment #3)
> As stated above, replace this line in /etc/conf.d/net:
> 
> config_myopname-8="dhcp"
> 
> with this:
> 
> config_myopname_8="dhcp"
> 
> This is a shell limitation; "-" is not allowed in variable names and must be
> replaced with "_".
> 
> After you do this report back to the bug and let us know if the issue is
> fixed.

Thank you!
As expected, this change fixes issue.

But to my mind it's not enough clear and ideally should be documented (together with 'SSID' format description) in /usr/share/doc/openrc-0.11.8/net.example.bz2.
Comment 5 William Hubbs gentoo-dev 2013-09-02 16:47:43 UTC
The format of a ssid is already documented in net.example. The following
was taken from there starting at line 397. I'm not sure how we can make
it more clear.

##############################################################################
# WIRELESS SSID IN VARIABLES
##############################################################################
# Remember to change SSID to your SSID.
# Say that your SSID is My NET - the line
#      #key_SSID="s:passkey"
# becomes
#      #key_My_NET="s:passkey"
# Notice that the space has changed to an underscore - do the same with all
# characters not in a-z A-Z (English alphabet) 0-9. This only applies to
# variables and not values.
#
# Any SSID's in values like essid_eth0="My NET" may need to be escaped
# This means placing the character \ before the character
# \" need to be escaped for example
# So if your SSID is
#      My "\ NET
# it becomes
#      My \"\\ NET
# for example
#      #essid_eth0="My\"\\NET"
#
# So using the above we can use
#      #dns_domain_My____NET="My\"\\NET"
# which is an invalid dns domain, but shows the how to use the variable
# structure
#########################################################