Network Manager bug

Wolfman/Cold Yes, I’m pointed to the xenial main repo - did apt-get upgrade and apt-get dist-upgrade; didn’t help. It’s wierd, sometimes after doing service network-manager restart it works fine for a long period, but other times it constantly disconnects, there are no networks showing when the network-manager icon is cllicked and it shows disconnected state, service network-manager restart command seems to have no effect, and the only way I can reconnect is by using WICD, and sometimes also closing and reopening the lid. Sometimes it takes a lot of coaxing and I have to try with WICD and closing/reopening the lid several times. Sometimes even after rebooting it comes up disconnected and I have to do this procedure because service network-manager-restart fails. . I do have managed set to “true” - seems to have no effect. The problem occurrence seems to be random. I have tried all manner of fixes from reinstalling the driver, to custom scripts - I even upgraded the operating system from Trusty-based to Xenial-based. None of this has had any effect on the problem. Another wierd thing is that sometimes it will actually be connected (without WICD running) but the Network Manager icon will show as disconnected. Sometimes the icon will show connected with bars, but actually be disconnected. The same wifi connection I have now worked fine with Ubuntu based Mint 14 from 3 or 4 years ago.

1 Like

I just tried that on two machines and while I won’t be convinced for a while that it fixed the problem, it did seem to have an immediate effect - all nets are now showing up.
May I ask where you got that information?
Can you also tell us why in the hell that parameter is set to ‘false’?

Source:

Alternative:

I’m not sure why it isn’t set to true by default.

Given the age of those posts, I think this might be a change introduced in systemd.

Edit: I was wrong, this was pre-systemd.
Also I asked about that on IRC and people tell me this change to the config file should have zero effect on the problem, given that it only concerns network interfaces that are defined in /etc/network/interfaces.

1 Like

As a better bandaid, click on the network manager icon while it is in the disconnected state. Then click the link to “Disable wifi”, wait 10 seconds (not sure this is necessary), then click on the link again to reenable wifi. Then do sudo service network-manager restart. So far this seems to be a reliable means of bringing the wifi up.

1 Like

Think this news might be related?

1 Like

Interesting article, thanks @Cold!. :thumbsup:

@everyone else, I have not had a drop out since updating in the last couple of days on my notebook!. :wink:

Ho provato a modificare il comando di avvio nella lista di avvio nm-applet in nm-applet-nogo e salvare e successivamente a rimodificarlo in nm-applet … dopo il riavvio l’applet appare … al successivo riavvio non riappare … funziona una volta sola ! Ripetendo la procedura si riottiene il funzionamento una sola volta … !

I’ll try to change the start command in the starting list from “nm-applet” in “nm-applet-nogo” and save then I re-change the command from “nm-applet-nogo” to the right command “nm-applet” and save … at the first reboot it seems to work but at 2nd reboot it stop working … If I repeat the process I can obtain newly such behavior!

Here’s my workaround to this icon problem:-

Write a bash script called “fixnm” and place it inside /usr/sbin (you may have to use sudo for this is you’re not running as root)

#!/bin/bash

wlan=/sbin/ifconfig wlp58s0 | grep inet\ addr | wc -l

while [ $wlan -eq 0 ]; do
sleep 1
wlan=/sbin/ifconfig wlp58s0 | grep inet\ addr | wc -l
done

sudo /etc/init.d/network-manager restart

So you now have a script /usr/sbin/fixnm that you can run. Do remember to enable the executable bit:-

chmod +x /usr/sbin/fixnm

What this script actually does is that it waits until the network interface wlp58s0 is up and when it is up, it will execute the network-manager restart command. For your application, you will want to insert into the above script your own interface name which you can determine using:-

ifconfig -a

The next part of this solution comes by using upstart to execute this script at the right time. You need to create a file called my-upstart-script.conf and place it inside the ~/.config/upstart/ directory.

start on desktop-start
stop on desktop-end

script
/usr/sbin/fixnm
end script

Like before, you need to enable the executable bit using:-

chmod +x ~/.config/upstart/my-upstart-config.conf

At this point - once the desktop is up and running, upstart will run this conf script, which will invoke /usr/sbin/fixnm which will make sure the connection is up and then restart the network-manager.

This solution is working on Ubuntu 16.04 running on my XPS 13 laptop.

Thanks, that worked for me.

There also a workaround : create script in pluma with somename.sh
> #!/bin/sh
> # Restart nm-applet
> killall nm-applet
> nm-applet

Then save to your home directory or any else and make it executable. Next just make a launcher on the panel( Add to Panel > Custom Application Launcher ) and browse your script.

p.s. hope it’s understandable, my english is no so good.