> Date: Tue, 12 Apr 2011 08:48:14 -0700 > From: Grant Erickson <[email protected]> > To: [email protected] > Cc: Alok Barsode <[email protected]> > Subject: Re: Manager {Disable, Enable}Technology Methods Lead to > Confused and Inconsistent State > Message-ID: <[email protected]> > Content-Type: text/plain; charset=us-ascii > > On Apr 9, 2011, at 1:02 PM, Grant Erickson wrote: > > FWIW and FYI, I am currently debugging an issue in which connman gets into an inconsistent state with respect to technologies and devices. When there are local connectivity problems, my application--for good or bad--periodically attempts to bring down and back up the network interface by executing the following connman .Manager methods: > > > > ... > > > > However, at times this results in a state in which the device and interface are DOWN yet connman believes the technology to be active and enabled: > > > > ... > > > > While I haven't yet caught why connman gets into this state, with the debugger, I can make a single variable change in which connman gets its state normalized again, the device and interface come up and all is good again: > > > > ... > > > > Interactive debugging aside, the only other way to get out of this state is to restart the system or connman, in particular. > > > > From what I can see of the overall function trace flow for net.connman.Manager.{Disable,Enable}Technology, writing "Powered=<state>" early in the method handling could lead to a state in which the persistent and internal states disagree: > > > > ... > > For those following this thread, I've distilled this down to a script that can reproduce this in about five minutes or so: > > #!/bin/sh > > log_info() { > local stamp=`date "+%FT%T"` > echo "${stamp}: $*" > echo "${stamp}: `hostname`: $*" 2>&1 | nc -w 5 ubuntu.local 6845 > } > > enable_technology() { > dbus-send --system --dest=net.connman --print-reply / > net.connman.Manager.EnableTechnology string:"wifi" > } > > disable_technology() { > dbus-send --system --dest=net.connman --print-reply / > net.connman.Manager.DisableTechnology string:"wifi" > } > > check_profile() { > grep -r '^Powered=' /var/lib/connman/ > } > > while [ 1 ]; do > log_info "Enabling Wi-Fi." > enable_technology > check_profile > sleep 5 > > log_info "Starting ping test." > ping ubuntu.local -c 10 > log_info "Ping test exited with status $?." > > log_info "Disabling Wi-Fi." > disable_technology > check_profile > sleep 15 > done > > Running this script, the failure seems to always be preceded by a timeout that follows the disable request: > > ... > --- ubuntu.local ping statistics --- > 10 packets transmitted, 10 packets received, 0% packet loss > round-trip min/avg/max = 105.133/163.327/215.850 ms > Ping test exited with status 0. > Disabling Wi-Fi. > Error net.connman.Error.OperationTimeout: Operation timeout > /var/lib/connman/default.profile:Powered=false > Enabling Wi-Fi. > nc: timed out > Error net.connman.Error.AlreadyEnabled: Already enabled > /var/lib/connman/default.profile:Powered=false > Starting ping test. > ... > > ... > --- ubuntu.local ping statistics --- > 10 packets transmitted, 10 packets received, 0% packet loss > round-trip min/avg/max = 31.555/118.661/307.220 ms > Ping test exited with status 0. > Disabling Wi-Fi. > Error net.connman.Error.OperationTimeout: Operation timeout > /var/lib/connman/default.profile:Powered=false > Enabling Wi-Fi. > nc: timed out > Error net.connman.Error.AlreadyEnabled: Already enabled > /var/lib/connman/default.profile:Powered=false > Starting ping test. > nc: timed out > ADDRCONF(NETDEV_UP): wlan0: link is not ready > ping: bad address 'ubuntu.local' > Ping test exited with status 1. > nc: timed out > Disabling Wi-Fi. > nc: timed out > Error net.connman.Error.Failed: No such device > /var/lib/connman/default.profile:Powered=false > Enabling Wi-Fi. > nc: timed out > Error net.connman.Error.AlreadyEnabled: Already enabled > ... > > Regards, > > Grant
Dunno if it helps but ...I've been attempting to get connman to connect with Gentoo. I used to get messages in the log after starting connman that the interface is being shutdown for a reason code which turned out to be the kernel shutting down the interface because I had set the country code in wpa_supplicant. o-O I am as of yet unable to start and run connman from the command line but it is getting close. I kind of dislike the overwriting /etc/resolv.conf with loopback address instead of letting dhcpd when called do it's thing and write the nameservers to the file. And if started on a working connection it will blow away the routing table and a working /etc/resolv.conf Do you know if it does this expecting to start iptables at this point and use the loopback to filter? If so will there be some sort of plugin for iptables? Since 0.68 (iirc) though I could edit /etc/resolv.conf and add the routes by hand and connman actually was not able to keep the Net from me ;-) I just don't do it that way ...since it's not automatic. David -djc- _______________________________________________ connman mailing list [email protected] http://lists.connman.net/listinfo/connman
