Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

captived: connman does not restart properly on PUT to /wifi/config #117

Closed
glfejer opened this issue Apr 23, 2020 · 3 comments · Fixed by xaptum/xaptum-buildroot#168
Closed
Assignees

Comments

@glfejer
Copy link
Contributor

glfejer commented Apr 23, 2020

To reproduce:
router is connected to MakeOffices wifi:

$ curl http://[2607:8f80:8100:0:e78d:c0c0:20cf:92dc]:4000/wifi/status
{
  "connected": true,
  "IPv4_addresses": [
    "192.168.2.222"
  ],
  "IPv6_addresses": [
    "fdc3:c108:dc6a:0:b2a6:f5ff:fe00:fbe",
    "fe80::b2a6:f5ff:fe00:fbe"
  ],
  "SSID": "MakeOffices"
}

New, broken.json configuration is:

{
	"contents": "[broken-wifi]\nType = wifi\nName = NonExistent\nPassphrase = NotValid123\nIPv4 = dhcp\nIPv6 = auto\n",
	"sha256": "29d8ecf5cefeae235981d525dc525c53cb3f4fd83904a5957740369521a224a3"
}

Update configuration:

curl -i -X PUT -H "Content-Type: application/json" -d "@broken.json" http://[2607:8f80:8100:0:e78d:c0c0:20cf:92dc]:4000/wifi/config/secure

Router card acknowledges the change.
Repeated calls to status shows no change in connected network.

Router card shows that connman has exited:

# systemctl status connman
â● connman.service - Connection service
   Loaded: loaded (/usr/lib/systemd/system/connman.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Thu 2019-02-14 18:36:19 UTC; 2min 6s ago
  Process: 218 ExecStart=/usr/sbin/connmand -n (code=killed, signal=HUP)
 Main PID: 218 (code=killed, signal=HUP)

Feb 14 10:12:15 buildroot connmand[218]: enf1 {update} flags 69841 <UP,RUNNING,LOWER_UP>
Feb 14 10:12:15 buildroot connmand[218]: enf1 {newlink} index 4 address 00:00:00:00:00:00 mtu 1280
Feb 14 10:12:15 buildroot connmand[218]: enf1 {newlink} index 4 operstate 6 <UP>
Feb 14 10:12:15 buildroot connmand[218]: enf1 {add} route 2607:8f80:8100:0:e78d:c0c0:20cf:92dc gw :: scope 0 <UNIVERSE>
Feb 14 10:12:15 buildroot connmand[218]: enf1 {add} address 2607:8f80:8100:0:e78d:c0c0:20cf:92dc/128 label (null) family
 10
Feb 14 10:12:16 buildroot connmand[218]: wlan0 {add} route fdc3:c108:dc6a:: gw :: scope 0 <UNIVERSE>
Feb 14 10:12:17 buildroot connmand[218]: wlan0 {add} address fdc3:c108:dc6a:0:b2a6:f5ff:fe00:fbe/64 label (null) family 
10
Feb 14 10:12:17 buildroot connmand[218]: Failed to find URL:http://ipv6.connman.net/online/status.html
Feb 14 18:36:19 buildroot systemd[1]: connman.service: Main process exited, code=killed, status=1/HUP
Feb 14 18:36:19 buildroot systemd[1]: connman.service: Succeeded.

Restarting connman with systemctl start connman causes router to disconnect from previous network, but doesn't connect to recovery network. Recovery network is visible when issuing connmanctl services

When a reboot issued via curl prior to restarting connman, the reboot succeeds and router card connects to recovery network.
After connman is restarted, a reboot must be issued on the board.

@glfejer glfejer self-assigned this Apr 23, 2020
@drbild
Copy link
Contributor

drbild commented Apr 23, 2020

Does captived issue a SIGHUP to connmand after updating the wifi config files?

EDIT:
Yes it does, via this command.

@drbild
Copy link
Contributor

drbild commented Apr 23, 2020

The connmand service should not be killed by the SIGHUP. I'd added code to just reload the configs in response to that signal. Perhaps that code got lost in the switch to the latest Buildroot?

EDIT:
Yep, those patches will install for connman 1.36:
https://github.com/xaptum/xaptum-buildroot/tree/master/buildroot-external-xaptum/patches/connman/1.36

But we're now on 1.37. Need to migrate those patches to 1.37.

@drbild
Copy link
Contributor

drbild commented Apr 23, 2020

I'll prep an updated patch for xaptum-buildroot. @glfejer Then you can give a test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants