Bug 135595

Summary: rcnetworkmanager stops network
Product: [openSUSE] SUSE Linux 10.1 Reporter: Andreas Schwab <schwab>
Component: NetworkAssignee: Christian Zoz <zoz>
Status: VERIFIED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Critical    
Priority: P5 - None CC: aj, dkukawka, ke, mvidner, werner
Version: unspecified   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: updated rcnetwork that handles NM, too

Description Andreas Schwab 2005-11-26 19:23:32 UTC
Stopping networkmanager must not shut down the interface.  That makes it impossible to unmount NFS filesystems.
Comment 1 Robert Love 2005-12-02 17:52:00 UTC
Could we just ensure that we stop NFS before NM?
Comment 2 Robert Love 2005-12-12 20:03:19 UTC
Or never stop ncnetworkmanager?
Comment 3 Andreas Schwab 2005-12-13 09:46:17 UTC
???
Comment 4 Robert Love 2005-12-13 15:07:14 UTC
Stopping the networkmanager service is supposed to down the interfaces.  The two are connected.

So, I ask, can we ensure that we stop NFS before we stop NM?
Comment 5 Andreas Schwab 2005-12-13 15:26:20 UTC
rcnetwork is responsible for stopping the interfaces.
Comment 6 Robert Love 2005-12-13 15:34:06 UTC
We've decided to make rcnetworkmanager and rcnetwork interchangable and (I think) mutually exclusive.

For example, rcnetwork is used if you are using the networking scripts; rcnetworkmanager is used if you are using NM.

Makes sense?
Comment 7 Robert Love 2005-12-13 15:34:45 UTC
By and by, this means we need to introduce a meta-dependency for both rcnetwork and rcnetworkmanager.  I have brought this up but I don't think anyone has done it yet.
Comment 8 JP Rosevear 2006-01-05 15:47:40 UTC
I see the nfs now relies on $network so is this cleared up?  Or does the networkmanager script need to add a provides still?
Comment 9 Christoph Thiel 2006-01-05 15:58:40 UTC
As long as only rcnetwork provides the "meta-dependency" it isn't clreaed up. NetworkManager needs to provide "network" in order to make things work.
Comment 10 Robert Love 2006-01-05 16:57:40 UTC
Right now, /etc/init.d/network provides "network" (not "$network").

Are you saying /etc/init.d/networkmanager just needs to provide "network" ?
Comment 11 Christoph Thiel 2006-01-05 17:04:31 UTC
If I get it right, networkmanager and rcnetwork exclude eachother (i.e. can't be activated at the same time), this would be an option IMHO. Because nfs-server needs "network" and will be stopped before network (i.e. before networkmanager, if it is used). [I thought this is was Schwab was complaining about ;))]
Comment 12 Robert Love 2006-01-05 21:26:23 UTC
Not sure exactly what I should do!

I tried providing "network" and "$network" (not at the same time) in the networkmanager initscript, but I still get insserv errors and am unable to delete the 'network' service.

Comment 13 Christoph Thiel 2006-01-05 21:42:13 UTC
Well, let's get zoz's opinion then ;)
Comment 14 Christoph Thiel 2006-01-05 21:54:49 UTC
After looking into this again I found

 /etc/insserv.conf:$network network +pcmcia +hotplug

So rcnetworkmanager should provide network (not $network). In addition we might need to change /etc/insserv.conf. Werner, could you please elaborate on that?
Comment 15 Robert Love 2006-01-06 16:41:05 UTC
I had /etc/init.d/networkmanager provide network but I still see problems (cannot "chkconfig --del network" for example).

Zoz?  Werner?  ;)
Comment 16 Robert Love 2006-01-06 16:41:28 UTC
*** Bug 141051 has been marked as a duplicate of this bug. ***
Comment 17 Christian Zoz 2006-01-09 10:52:27 UTC
My opinion is that:
It makes no sense that nfs requires rcnetworkmanager, because rcnetworkmanager does only start NM and does not ensure that there is an active network connection.
It does not make sense to use NM and nfs together.
Comment 18 Christian Zoz 2006-01-09 10:53:39 UTC
*** Bug 141579 has been marked as a duplicate of this bug. ***
Comment 19 Dr. Werner Fink 2006-01-09 15:59:44 UTC
All scripts nedding network connection should use the
system provides `$network'.  This system provide is
defined in /etc/insserv.conf (see manual page insserv).
Btw: `chkconfig' uses insserv.  That means that using
insserv in delete mode the program will not accept
removing a service if this service is required by other
services.  You can overwrite this by using the option
`-f' (-> man insserv).
Comment 20 Dr. Werner Fink 2006-01-09 17:19:58 UTC
To get both NM and the network script installed in parallel but exclusively
enabled we may use two different provides which may mapped both optional to
the system facility $network ... on the other hand we could also start NM
by the network script by controlling this with a sysconfig variable and
a lock in /var/lock/subsys/ to distinguish the current used mode.
Comment 21 Christoph Thiel 2006-01-09 17:22:16 UTC
Thanks Werner -- I guess that was the missing piece we needed to be able to fix this problem, Robert?
Comment 22 Robert Love 2006-01-09 17:32:48 UTC
So I have networkmanager provide "network" and have all requiring initscripts require "$network" ?

Will do.

I also like Werner's second idea, though.  We could move the networkmanager initscript into the network script and have it instantiate the proper networking system (if* scripts or NM) based on a configuration option.
Comment 23 Christoph Thiel 2006-01-09 17:36:48 UTC
For the first approach you would just need to provide some string and Werner would fix /etc/insserv.conf accordingly.

But actually I thinks we should go for the second idea - Zoz, would you accept a patch to rcnetwork?
Comment 24 Christian Zoz 2006-01-10 11:05:12 UTC
Yes.
We can use 
  /etc/sysconfig/network/config:NETWORKMANAGER=yes
as control variable. With this info also ifup can print informative messages if it is called while NM is running.
Comment 25 Christoph Thiel 2006-01-10 15:41:43 UTC
Alright, Robert, will you take care of patching rcnetwork? It's part of the package sysconfig. Who will add /etc/sysconfig/network/config:NETWORKMANAGER=yes?
Comment 26 Dr. Werner Fink 2006-01-11 13:20:29 UTC
*** Bug 139589 has been marked as a duplicate of this bug. ***
Comment 27 Robert Love 2006-01-12 19:41:18 UTC
*** Bug 142829 has been marked as a duplicate of this bug. ***
Comment 28 Robert Love 2006-01-12 19:58:08 UTC
Alright.  Find attached an updated rcnetwork that starts NetworkManager if (a) the config option is set to "yes" and (b) NetworkManager is installed.  Otherwise, it falls through and performs the usual rcnetwork steps.

The idea would be to (a) replace rcnetwork in sysconfig with this and (b) remove the networkmanager initscript from the NetworkManager package.

I think this is definitely the way to go.

Zoz:  If you like the changes, I can commit it if you want.
Comment 29 Robert Love 2006-01-12 19:58:43 UTC
Created attachment 63179 [details]
updated rcnetwork that handles NM, too
Comment 30 Robert Love 2006-01-12 22:45:56 UTC
Also, we will need the YaST changes in place, too.
Comment 31 Martin Vidner 2006-01-13 14:15:39 UTC
Oh, nice to learn about this change one day before Beta1. Please next time cc me sooner.

No, I think that the single service model is wrong, at least in the proposed implementation. Keep in mind the scenario of switching between ifup and NM.
What should be the correct way of turning off a running NM and setting up the interfaces using ifup? You'd have to call the script twice anyway, so it's better to keep them separate.

I think that noone has yet presented arguments why the single service model would be better. I think that it is better to fix insserv to accept networkmanager providing network. It should be enough. I don't mind
insserv -r -f network; insserv networkmanager.
Comment 32 Dr. Werner Fink 2006-01-13 14:35:03 UTC
There is nothing to fix for insserv. Two scripts providing the
same service is what I call a BUG.  This because we run into
deep trouble if we would allow this.  Think about scripts from
customers and 3dr party vendors.
Comment 33 Martin Vidner 2006-01-13 14:41:34 UTC
3rd party scripts must by LSB have unique script names. LSB says nothing about uniqueness of facility names.
But anyway, then make a special case so that $network is provided either by network or networkmanager.
Comment 34 Dr. Werner Fink 2006-01-13 14:44:10 UTC
Btw: using a specific lock for NM or ifup mode in /var/lock/subsys/
should help to avoid mixing up NM with ifup and vice versa.
Comment 35 Dr. Werner Fink 2006-01-13 14:45:18 UTC
I'm not willingly to add a bug.
Comment 36 Christian Zoz 2006-01-13 14:48:08 UTC
I cannot see problems if both are one service. Just change the settings and restart the service. The same way as with every other service.

The propsed patch does not work if someone changed NETWORKMANAGER=yes/no and then simply restarts. I will change that.
Comment 37 Christoph Thiel 2006-01-13 14:52:31 UTC
I'd also second this approach, as it will be much easier for people to just use rcnetwork (which they are used to) than using rcnetwork sometimes and sometimes rcnetworkmanager... 
Comment 38 Martin Vidner 2006-01-13 14:53:49 UTC
Thanks. Please keep in mind that yast uses reload instead of restart.
Comment 39 Christian Zoz 2006-01-13 15:29:42 UTC
Yes, i already had it in mind. In case of a system change reload will do a restart.
Comment 40 Robert Love 2006-01-13 16:26:54 UTC
I prefer the single script solution, too.

Note we need to coordinate the changes between YaST, sysconfig, and NetworkManager ... so let's make sure we commit the changes in unison.
Comment 41 Christoph Thiel 2006-01-13 16:40:02 UTC
So, I guess Zoz is working on getting the changes into the sysconfig package, right? In addition to that we only need to strip the rcnetworkmanager script from NetworkManager (Robert?) and make YaST aware of this change (Martin?). Do you guys think we can make this work for Beta1?
Comment 42 Robert Love 2006-01-13 16:55:23 UTC
Correct.  I'll drop rcnetworkmanager from NetworkManager soon as the other bits are in place.
Comment 43 Christian Zoz 2006-01-15 15:59:03 UTC
I'm just working on this (beside other changes) and will submit a changed package not later than tomorrow. The network script will warn you if the setting of NETWORKMANAGER and the current state do not match. Changing NETWORKMANAGER and calling rcnetwork restart or relaod will work.

Also ifup will check NETWORKMANAGER and send a dbus message to NM if needed. And will inform the user.

Martin, will YaST ever write STARTMODE=managed?
Robert, will NM check STARTMODE?
Comment 44 Martin Vidner 2006-01-15 16:08:37 UTC
No, yast will not write STARTMODE=managed. I am just working on config:NWTWORKMANAGER.
Comment 45 Robert Love 2006-01-15 16:18:59 UTC
No, NM does not check STARTMODE.
Comment 46 Christian Zoz 2006-01-15 20:28:40 UTC
There is also service networkmanager-dispatcher. It requires networkmanager. Since we have no service networkmanager anymore it has to require network. Now when NETWORKMANAGER=no networkmanager-dispatcher will fail.
Therefore i integrated also start/stop of the dispatcher in service network. Controlled by another sysconfig variable NM_DISPATCHER, which will be 'yes' by default.

OK?
Comment 47 Martin Vidner 2006-01-16 13:54:53 UTC
OK. Please do not forget to add "## Type: yesno" to the variables, YaST depends on it.
Christian can I submit the YaST changes for Beta 1?
Comment 48 Christian Zoz 2006-01-16 14:48:48 UTC
Yes you can, i will submit sysconfig later __today__.

(((have a look at mobile@sue.de)))
Comment 49 Robert Love 2006-01-16 15:40:47 UTC
Zoz: Alright, and I will submit the NM changes today, too.  For NM, I will remove both the networkmanager and networkmanager-dispatcher initscripts.
Comment 50 Christian Zoz 2006-01-16 15:50:03 UTC
Robert, i'm just writing comments for the new sysconfig variables. I would like to point to some doc for the dispatcher. Will we have a manpage or a README?
Comment 51 Robert Love 2006-01-16 15:57:12 UTC
I will be happy to write a manpage.  Not in time for beta 1, though!
Comment 52 Christian Zoz 2006-01-16 16:24:23 UTC
Fine.
Comment 53 Robert Love 2006-01-16 17:24:58 UTC
NM changes are checked in: We no longer install or insserv networkmanager and networkmanager-dispatcher initscripts.
Comment 54 Christian Zoz 2006-01-16 21:29:50 UTC
submitted sysconfig package.

This still needs to be documented.

BTW:
I also changed ifup to send a dbus message to NM and inform the user. I introduced a variable NM_CONTROLLED that allos manual control of an interface while NM is running. Of course it would be nice if NM could also respect this variable and ignore this interface.
Comment 55 Christian Zoz 2006-01-17 15:20:37 UTC
Let's see if our changes fit together
Comment 56 Robert Love 2006-01-17 16:06:20 UTC
The sysconfig + NM bits work for me!  I have not tried the updated YaST to see if it writes out the right data, or what the UI looks like, but the new rcnetwork works great with NM.

Thanks.

I do see a lot of loops detected by insserv, such as

    insserv: There is a loop between service network and haldaemon

But that may be because I have not yet updated other packages.
Comment 57 Dr. Werner Fink 2006-01-17 16:09:11 UTC
That is not a bug of insserv but a feature ;)
Comment 58 Robert Love 2006-01-17 16:11:53 UTC
Naturally.  Its a bug in the initscripts, though, if the problem persists.
Comment 59 Christian Zoz 2006-01-17 20:07:52 UTC
And it were a much better feature of insserv if insserv -v would tell more about the loop. For example which other services are in the loop. Is that possible?

insserv told me about a loop between cron and syslog but i could not see it. I looked into .depend.start. 
Comment 60 Dr. Werner Fink 2006-01-19 15:30:20 UTC
Because of the editing mode of YaST2 for the runlevels and the service
links therein it can happen that if there are only a few scripts installed
insserv can not determine the correct star/stop number.  But insserv uses
the link scheme to overwrite the dependcies given by the LSB comments
(the only way to use the editing mode of YaST2 in all manners). I do not
like this.  Therefore I've enforced the `-d' option of insserv to resolve
such a loop.  See newest insserv package from today.