[wifi-ap] AP is not re-established after a reboot
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snappy-hwe-snaps |
Fix Released
|
High
|
Alfonso Sanchez-Beato |
Bug Description
An AP created with "sudo wifi-ap.
This happens not only on reboots, but also when NM re-starts. Therefore, this will happen also when there is an NM snap update.
admin@1234567:~$ snap services wifi-ap
Snap Service Startup Current
wifi-ap automatic-setup enabled inactive
wifi-ap management-service enabled active
admin@1234567:~$ ps -ef|grep hostapd
admin 5036 4949 0 13:52 pts/0 00:00:00 grep --color=auto hostapd
admin@1234567:~$ network-
DEVICE TYPE STATE CONNECTION
eth0 ethernet connected Wired connection 1
wlan0 wifi disconnected --
lo loopback unmanaged --
admin@1234567:~$ snap list
Name Version Rev Developer Notes
alsa-utils 1.1.2-5 68 canonical -
bluez 5.44-3 129 canonical -
caracalla 16.04-1.35 49 canonical gadget
caracalla-kernel 4.4.0-116.140-1 77 canonical kernel
core 16-2.31.2 4206 canonical core
locationd 4.2.1 163 canonical -
modem-manager 1.6.12-1 120 canonical -
network-manager 1.2.2-15-dev x1 -
snapweb 0.26-11 319 canonical -
tpm2 1.0-5 42 canonical -
udisks2 2.6.4-2 100 canonical -
uefi-fw-tools 1.5.2-0.7.2+git 10 canonical -
wifi-ap 17 204 canonical -
wpa-supplicant 2.4.3 41 canonical -
Related branches
- System Enablement Bot: Approve (continuous-integration)
- Konrad Zapałowicz (community): Approve (code)
-
Diff: 191 lines (+82/-18)5 files modifiedcmd/service/service.go (+74/-16)
spread.yaml (+0/-1)
tests/lib/prepare-each.sh (+6/-1)
tests/main/conf-from-gadget/task.yaml (+1/-0)
tests/main/conf-wizard-disabled-from-gadget/task.yaml (+1/-0)
Changed in snappy-hwe-snaps: | |
importance: | Undecided → High |
description: | updated |
Changed in snappy-hwe-snaps: | |
status: | New → In Progress |
assignee: | nobody → Alfonso Sanchez-Beato (alfonsosanchezbeato) |
It turns out that this is a race condition that happens when the wifi-ap management service starts before NetworkManager. In that case, when wifi-ap tries to set the wifi interface as "unmanaged" in NM by using nmcli, NM is not yet there. In the moment NM starts, it takes control of the wifi interface and hostapd dies. See attached log. Interesting traces:
Mar 23 16:18:21 1234567 wifi-ap. management- service[ 3461]: Error: NetworkManager is not running. 3455]: <info> [1521821902.6045] NetworkManager (version 1.2.2) is starting...
Mar 23 16:18:22 1234567 NetworkManager[