Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 485658 - sys-apps/systemd: /etc/conf.d/hostname interfers with hostname setting due networkmanager ifnet plugin
Summary: sys-apps/systemd: /etc/conf.d/hostname interfers with hostname setting due ne...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords: NeedPatch
: 485754 (view as bug list)
Depends on:
Blocks: gnome-3.8-stable
  Show dependency tree
 
Reported: 2013-09-22 14:41 UTC by Pacho Ramos
Modified: 2014-03-15 10:38 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pacho Ramos gentoo-dev 2013-09-22 14:41:02 UTC
I finally found why what hostnamectl calls "transient" hostname was still localhost: looks like something is reading the old value from /etc/conf.d/hostname (the openrc config one), but I don't know what is doing this yet :|
Comment 1 Mike Gilbert gentoo-dev 2013-09-22 16:46:18 UTC
If you are using NetworkManager, it is probably being read by the ifnet plugin.
Comment 2 Pacho Ramos gentoo-dev 2013-09-22 21:07:52 UTC
That would explain this. It's done in:
rc/settings/plugins/ifnet/plugin.c :/
Comment 3 Pacho Ramos gentoo-dev 2013-09-24 06:31:29 UTC
*** Bug 485754 has been marked as a duplicate of this bug. ***
Comment 4 Mike Gilbert gentoo-dev 2013-09-25 16:54:49 UTC
One possible solution: Change the default config to enable or disable the ifnet plugin based on the systemd use flag.
Comment 5 Pacho Ramos gentoo-dev 2013-09-25 21:15:51 UTC
Will try to handle it before getting gnome stabilized :/

Probably it's the right thing to do as ifnet plugins looks to be related with openrc stuff only
Comment 6 Pacho Ramos gentoo-dev 2013-09-28 08:57:48 UTC
Is there a way to sync keys between ifnet and keyfile plugins to prevent people from needing to put their password again?
Comment 7 Alexandre Rostovtsev (RETIRED) gentoo-dev 2013-10-04 02:05:47 UTC
I think a better approach would be to simply prefer the systemd hostname over /etc/conf.d/hostname.
Comment 8 Pacho Ramos gentoo-dev 2013-10-04 06:39:09 UTC
But last time I saw the ifnet plugin, it will also play with the conf.d/net stuff, and maybe that is more prone to errors :/

As a side note, maybe it's "better" to try to use keyfile plugin when possible (as it's the case when running systemd) because it's more tested by upstream and, once user is not running openrc, I don't see any reason to keep using ifnet plugin
Comment 9 Pacho Ramos gentoo-dev 2013-10-05 13:39:33 UTC
+*networkmanager-0.9.8.6 (05 Oct 2013)
+
+  05 Oct 2013; Pacho Ramos <pacho@gentoo.org> +networkmanager-0.9.8.6.ebuild,
+  -networkmanager-0.9.6.4-r1.ebuild, -networkmanager-0.9.8.2-r3.ebuild:
+  Version bump, use keyfile plugin instead of ifnet for systemd to prevent
+  collisions and problems like bug #485658
+
Comment 10 Dennis Schridde 2013-10-06 13:47:53 UTC
Can you please inform the users more verbosely of the consequences of the removal of the ifnet plugin?

I had to delete /etc/NetworkManager/NetworkManager.conf to be able to start KDE. Otherwise NetworkManager would not start, because it tried to load the ifnet pluginm which is mentioned in the config. The stopped service or missing network connectivity then seems to have torn the rest of the system with it.
Comment 11 Pacho Ramos gentoo-dev 2013-10-06 14:15:02 UTC
I put a warning about the need of filling passwords again, about the other problem with that directory, I didn't suffer it :|

That is probably because I never edited the file myself and, then, portage removed it cleanly

+  06 Oct 2013; Pacho Ramos <pacho@gentoo.org> networkmanager-0.9.8.6.ebuild:
+  Add a warning for people having a NetworkManager.conf that loads ifnet plugin
+  preserved for some reason (#485658#c10 by Dennis Schridde)
+
Comment 12 Dennis Schridde 2013-10-06 14:47:33 UTC
(In reply to Pacho Ramos from comment #11)

Thanks!
Comment 13 Fabio Erculiani (RETIRED) gentoo-dev 2014-03-15 08:51:45 UTC
so now that networkmanager doesn't use ifnet anymore when USE=systemd, how do I setup static network with NM and systemd?
What's the official way to do that?
Comment 14 Pacho Ramos gentoo-dev 2014-03-15 10:08:02 UTC
You can use nm-connection-editor and gnome-control-center for configuring network with static IP
Comment 15 Fabio Erculiani (RETIRED) gentoo-dev 2014-03-15 10:19:32 UTC
My use case is this: i have a bunch of headless home servers that have static IP for historic reasons. Until NM 0.9.6.4 I could just use /etc/conf.d/net, even when running systemd. There is not X, so nm-connection-editor is not really a nice solution.

Now you are deliberately disabling this without, correct me if I'm wrong, too much advertisement (user that upgrades and reboots may not realize that they lose the whole network configuration!).

So, something that was previously possible (using conf.d/net) is no longer possible and there does not seem to be a documented migration path :/.
Comment 16 Pacho Ramos gentoo-dev 2014-03-15 10:38:44 UTC
I added warnings long time ago and also a note to the upgrade guide (this was done with the jump from Gnome 2.32 to 3.8):
        if use systemd; then
                if [[ ${REPLACING_VERSIONS} < 0.9.8.6 ]]; then
                        ewarn "Ifnet plugin won't be used with systemd support enabled"
                        ewarn "as it is meant to be used with openRC and can cause collisions"
                        ewarn "(like bug #485658)."
                        ewarn "Because of this, you will likely need to reconfigure some of"
                        ewarn "your networks."
                fi

                if [[ -e "${EROOT}etc/NetworkManager/NetworkManager.conf" ]]; then
                        if grep -q plugins "${EROOT}etc/NetworkManager/NetworkManager.conf" | grep -q ifnet; then
                                ewarn "You seem to use 'ifnet' plugin in ${EROOT}etc/NetworkManager/NetworkManager.conf"
                                ewarn "Since it won't be used when running under Systemd, you will need to stop setting"
                                ewarn "ifnet plugin there to allow NetworkManager to work."
                        fi
                fi
        fi

Regarding how to configure it manually, I am not sure as I have always used gui tools to that. 

At http://en.opensuse.org/SDB:Knetworkmanager_static_ip_auto_eth0#Method_1_-_System_Connection_.28Auto_eth0.29 you have some examples of the kind of files that are created by the tool