Summary: | knetworkmanager confused by /etc/init.d/network restart | ||
---|---|---|---|
Product: | [Unmaintained] knetworkmanager | Reporter: | Tristan Miller <psychonaut> |
Component: | general | Assignee: | Will Stephenson <wstephenson> |
Status: | RESOLVED INTENTIONAL | ||
Severity: | normal | CC: | benderamp, lamarque, ruchir.brahmbhatt |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Unspecified | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
hack to restart knetworkmanager
hack to restart knetworkmanager if it was running. hack to restart knetworkmanager if it was running. |
Description
Tristan Miller
2010-04-06 11:36:22 UTC
I tried to figure out why this is happening but failed. I have found some weird berhaviour in solid networkmanager support (knetworkmanager also has the same behaviour). For some reason solid networkmanager backend (solid/networkmanager-0.7/manager.cpp) and knetworkmanager do not receive signals from networkmanager if it restarts. For instance in solid/networkmanager-0.7/manager.cpp: 1. NMNetworkManager::NMNetworkManager(QObject * parent, const QStringList &) 2. { 3. qDBusRegisterMetaType<QList<QDBusObjectPath> >(); 4. d_ptr = new NMNetworkManagerPrivate; 5. Q_D(NMNetworkManager); 6. d->nmState = d->iface.state(); 7. d->isWirelessHardwareEnabled = d->iface.wirelessHardwareEnabled(); 8. d->isWirelessEnabled = d->iface.wirelessEnabled(); 9. connect( &d->iface, SIGNAL(DeviceAdded(const QDBusObjectPath &)), 10. this, SLOT(deviceAdded(const QDBusObjectPath &))); 11. connect( &d->iface, SIGNAL(DeviceRemoved(const QDBusObjectPath &)), 12. this, SLOT(deviceRemoved(const QDBusObjectPath &))); 13. connect( &d->iface, SIGNAL(PropertiesChanged(const QVariantMap &)), 14. this, SLOT(propertiesChanged(const QVariantMap &))); 15. connect( &d->iface, SIGNAL(StateChanged(uint)), 16. this, SLOT(stateChanged(uint))); 17. 18. d->iface.connection().connect(QLatin1String("org.freedesktop.DBus"), 19. QLatin1String("/org/freedesktop/DBus"), 20. QLatin1String("org.freedesktop.DBus"), 21. QLatin1String("NameOwnerChanged"), QLatin1String("sss"), 22. this, SLOT(nameOwnerChanged(QString,QString,QString))); The connects in lines 9, 11, 13, and 15 have no effect when networkmanager restart, but the connect in line 18 still works. In knetworkmanager/monolithic/knetworkmanagertrayicon.cpp: KNetworkManagerTrayIcon::KNetworkManagerTrayIcon(... . . . // hide the icon when network management is unavailable QObject::connect(Solid::Control::NetworkManager::notifier(), SIGNAL(statusChanged(Solid::Networking::Status)), this, SLOT(networkingStatusChanged(Solid::Networking::Status))); The slot networkingStatusChanged sometimes is called when networkmanger stops, but it is never called when it starts again. In knetworkmanager/backends/NetworkManager/nmdbussettingsconnectionprovider.cpp, NMDBusSettingsConnectionProvider::onRemoteConnectionRemoved: if I delete d->iface and create a new one then I got a notification saying that networking system has been disabled, without this change I never get one. I suspect for some reason all classes connected to org.freedesktop.networkmanager when networkmanager closes does not reconnect when networkmanager restarts again. I just have not figure out why. I forgot to say that the networkmanagement kded module still works correctly. Even if the tray icon do not react the interfaces marked as "autoconnect" continues to connect in background and I can use the Internet normally. Created attachment 43179 [details]
hack to restart knetworkmanager
This hack closes knm's tray icon when networkmanager is gone from dbus and starts it again when networkmanager registers to dbus. It is not a solution but at least makes knm restart automatically.
Created attachment 43680 [details]
hack to restart knetworkmanager if it was running.
This version only restarts knm if it was running when NetworkManager was closed. That way it does not disturb who uses plasma applet or nm-applet.
Created attachment 43682 [details]
hack to restart knetworkmanager if it was running.
It seems knm has to run after NM or it will not receive signals from Notifier, this is the problem I described in my first post. So let's do it differently. Now it works as expected, just make sure NM is running when the first instance of knm starts, knm will not work properly otherside.
I do not have problems with NM restart anymore. I am using KDE SC 4.5.1, NetworkManager 0.8 and svn Plasma NM from September 8th. Could someone test if this problem is really fixed? Bug 236521 appears to be a duplicate of this one. *** Bug 236521 has been marked as a duplicate of this bug. *** Please use Plasma NetworkManager instead of knetworkmanager, it does not suffer from this problem. Knetworkmanager monolithic is not being developed anymore. *** Bug 223080 has been marked as a duplicate of this bug. *** |