Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 369711 - net-misc/networkmanager generates an incorrect /etc/conf.d/net file for openrc
Summary: net-misc/networkmanager generates an incorrect /etc/conf.d/net file for openrc
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: Mu Qiao (RETIRED)
URL:
Whiteboard:
Keywords:
: 402779 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-06-01 23:27 UTC by Cedric
Modified: 2012-02-20 02:45 UTC (History)
8 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 Cedric 2011-06-01 23:27:46 UTC
Since updating openrc/baselayout, net.eth0 doesn't start with error:

 * Bringing up interface eth0
 *   192.168.1.2/24 ...
RTNETLINK answers: File exists                                                                                       [ !! ]
 * ERROR: net.eth0 failed to start

Starting net.eth0 manually doesn't work either. I tried modifying /etc/conf.d/net, but for a mysterious reason, it restores itself at it previous state when trying to start net.eth0. Note that modifying this file, make net.eth0 sometimes start, but only once. At next boot, it fails again.

Reproducible: Always
Comment 1 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2011-06-02 01:20:35 UTC
Are you using ifconfig syntax and have iproute2 installed in your system?

If so this is a duplicate of bug 366905.
Comment 2 Cedric 2011-06-02 12:09:08 UTC
Is that if config syntax?

#Generated by NetworkManager
###### Global Configuration ######

###### Connection Configuration ######
#----------------------------------
dns_servers_eth0="212.27.40.240 212.27.40.241"
routes_eth0=( "default via 192.168.1.1" )
auto_eth0="true"
config_eth0=( "192.168.1.2/24" )
enable_ipv6_eth0="false"
Comment 3 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2011-06-02 12:25:45 UTC
That is iproute2 syntax.

I'm reassigning to maintainers.
Comment 4 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2011-06-02 12:30:40 UTC
(In reply to comment #0)

> Starting net.eth0 manually doesn't work either. I tried modifying
> /etc/conf.d/net, but for a mysterious reason, it restores itself at it previous
> state when trying to start net.eth0. 

Looking at the config file, you are using networkmanager. That's what's "mysteriously" modifying the config file.

@openrc:

can this be a problem of compatibility from networkmanager?
Comment 5 William Hubbs gentoo-dev 2011-06-02 17:44:34 UTC
(In reply to comment #2)
> #Generated by NetworkManager

Networkmanager is generating an incorrect /etc/conf.d/net. It is still using bash arrays, which are not supported by openrc. I'll point out what needs to change below:

> ###### Global Configuration ######
> 
> ###### Connection Configuration ######
> #----------------------------------
> dns_servers_eth0="212.27.40.240 212.27.40.241"
> routes_eth0=( "default via 192.168.1.1" )

Needs to change to:

routes_eth0="default via 192.168.1.1"

> auto_eth0="true"
> config_eth0=( "192.168.1.2/24" )

Needs to change to:

config_eth0="192.168.1.2/24"


> enable_ipv6_eth0="false"
Comment 6 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2011-06-02 17:49:09 UTC
Reassigning bug to maintainers.
Comment 7 Mu Qiao (RETIRED) gentoo-dev 2011-06-04 02:59:16 UTC
Hi, all

I fixed this problem but I'd like to hear from you if my approach is OK.

I added an option in /etc/NetworkManager/nm-system-settings.conf so a user can choose to use baselayout style or openrc style. For reading /etc/conf.d/net, both formats can be accepted by the plug-in. But writing to /etc/conf.d/net will require the user to correctly set the option. The benefit is the use won't have to manually edit /etc/conf.d/net if he migrates to a different init system.

We can add a elog message to inform users to set the option.
Comment 8 Cedric 2011-06-04 12:45:33 UTC
But the user will have to edit /etc/NetworkManager/nm-system-settings.conf. What's the difference?
Comment 9 Mu Qiao (RETIRED) gentoo-dev 2011-06-04 15:01:46 UTC
(In reply to comment #8)
> But the user will have to edit /etc/NetworkManager/nm-system-settings.conf.
> What's the difference?

I'd like to avoid pushing the work to users if there's a reliable way to determine the right style at runtime.
Comment 10 Mu Qiao (RETIRED) gentoo-dev 2011-06-06 03:48:11 UTC
After reconsidering the problem, I don't think we need this change for now.

You shouldn't use both NM and openrc to manage the same interface. If you want to use openrc to manage the interface, please delete the connection in NM. Then there won't be a problem. If you want to use them together, please at least let them manage different interfaces.
Comment 11 Cedric 2011-06-06 08:26:28 UTC
And if I want to use NM and not openrc? KDE depends directly on NM for network management.
Comment 12 Mu Qiao (RETIRED) gentoo-dev 2011-06-06 09:08:13 UTC
(In reply to comment #11)
> And if I want to use NM and not openrc? KDE depends directly on NM for network
> management.

Then use rc-update to remove that connection. I use KDE too and there isn't a problem.
Comment 13 Cedric 2011-06-06 09:53:00 UTC
Ok, doesn't seem to show any problems. Maybe the 'How To' should be updated to warn NM users not to add net.eth0 to rc-update?!
Comment 14 Nirbheek Chauhan (RETIRED) gentoo-dev 2011-06-06 11:04:52 UTC
(In reply to comment #10)
> After reconsidering the problem, I don't think we need this change for now.
> 
> You shouldn't use both NM and openrc to manage the same interface. If you want
> to use openrc to manage the interface, please delete the connection in NM. Then
> there won't be a problem. If you want to use them together, please at least let
> them manage different interfaces.

I believe the point of maintaining compatibility with baselayout/openrc is that people can switch between NM and baselayout-1/openrc without having to change anything in their network configuration file.

Also, correct me if I'm wrong, but why do we need to use bash arrays at all? Doesn't baselayout-1 work with bash strings?
Comment 15 Mu Qiao (RETIRED) gentoo-dev 2011-06-06 12:42:48 UTC
(In reply to comment #14)
> (In reply to comment #10)
> > After reconsidering the problem, I don't think we need this change for now.
> > 
> > You shouldn't use both NM and openrc to manage the same interface. If you want
> > to use openrc to manage the interface, please delete the connection in NM. Then
> > there won't be a problem. If you want to use them together, please at least let
> > them manage different interfaces.
> 
> I believe the point of maintaining compatibility with baselayout/openrc is that
> people can switch between NM and baselayout-1/openrc without having to change
> anything in their network configuration file.
> 
> Also, correct me if I'm wrong, but why do we need to use bash arrays at all?
> Doesn't baselayout-1 work with bash strings?

The point is people should never let init system and NM manage the same interface, no matter what init system you are using. So actually there isn't a compatibility problem.

I'm not sure if baselayout-1 can understand the content of bash strings if they contain multiple IP addresses.
Comment 16 Davide Pesavento (RETIRED) gentoo-dev 2011-11-29 22:45:38 UTC
(In reply to comment #15)
> (In reply to comment #14)
> > (In reply to comment #10)
> > > After reconsidering the problem, I don't think we need this change for now.
> > > 
> > > You shouldn't use both NM and openrc to manage the same interface. If you want
> > > to use openrc to manage the interface, please delete the connection in NM. Then
> > > there won't be a problem. If you want to use them together, please at least let
> > > them manage different interfaces.
> > 
> > I believe the point of maintaining compatibility with baselayout/openrc is that
> > people can switch between NM and baselayout-1/openrc without having to change
> > anything in their network configuration file.
> > 
> > Also, correct me if I'm wrong, but why do we need to use bash arrays at all?
> > Doesn't baselayout-1 work with bash strings?
> 
> The point is people should never let init system and NM manage the same
> interface, no matter what init system you are using. So actually there isn't a
> compatibility problem.
> 

Yes, there is a compatibility problem. /etc/conf.d/net is parsed each time the dependencies are recalculated and this means the following ugly output:

 * Caching service dependencies ...
/lib64/rc/sh/gendepends.sh: 9: /etc/init.d/../conf.d/net: Syntax error: "(" unexpected
/lib64/rc/sh/gendepends.sh: 9: /etc/init.d/../conf.d/net: Syntax error: "(" unexpected       

> I'm not sure if baselayout-1 can understand the content of bash strings if they
> contain multiple IP addresses.

baselayout-2 and openrc have been stable for months, baselayout-1 was removed from portage almost 3 months ago. We should stop worrying about baselayout-1 compatibility :)
Comment 17 Mu Qiao (RETIRED) gentoo-dev 2011-12-06 08:56:36 UTC
OK, I'm working on it.
Comment 18 Mu Qiao (RETIRED) gentoo-dev 2011-12-07 03:11:06 UTC
Fixed in networkmanager-0.9.2.0-r1.ebuild. I'll leave this bug open for a few days.
Comment 19 Mu Qiao (RETIRED) gentoo-dev 2011-12-14 01:41:36 UTC
Pushed to upstream. Close it now.
Comment 20 Mu Qiao (RETIRED) gentoo-dev 2012-02-20 02:45:46 UTC
*** Bug 402779 has been marked as a duplicate of this bug. ***