CanonicalLtd / UCWifiConnect

The code of this project has been moved to https://code.launchpad.net/~snappy-hwe-team/snappy-hwe-snaps/+git/wifi-connect
GNU General Public License v3.0
2 stars 2 forks source link

server.running() does not always return the correct state #29

Closed knitzsche closed 7 years ago

knitzsche commented 7 years ago

Before starting or stopping the mgmt server, the daemon checks the state with server.running(), for example here: https://github.com/CanonicalLtd/UCWifiConnect/blob/master/daemon/daemon.go#L99

The running() method sometimes seems to return an incorrect value, in which case the mgmt server start function [1] is not executed when it should be. The mgmt server startup function code also writes the flag file that controls daemon state. If the flag file is not present, the daemon does not think has entered management mode and loops incorrectly.

For now, I will simply run the methods to start/stop the mgmt server without checking the values first.

[1] https://github.com/CanonicalLtd/UCWifiConnect/blob/master/server/manager.go#L54