Bug 808039

Summary: No network without networkmanager (cloned from #798348 to track the second issue)
Product: [openSUSE] openSUSE 12.3 Reporter: Alberto Planas Dominguez <aplanas>
Component: NetworkAssignee: Michal Filka <mfilka>
Status: VERIFIED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Major    
Priority: P5 - None CC: aj, arvidjaar, aschnell, carnold, coolo, fcrozat, forgotten_5jFyFBvk-I, forgotten_xRcrmyYBVX, freek, heiko.rommel, jsuchome, jweberhofer, kkaempf, locilka, mfilka, mt, mvidner, paul.zirnik, rb03884, ro, wstephenson
Version: RC 2   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Bug Depends on: 798348, 800365    
Bug Blocks:    
Attachments: YaST2 log after stage2

Description Alberto Planas Dominguez 2013-03-07 12:01:16 UTC
Created attachment 528702 [details]
YaST2 log after stage2

+++ This bug was initially created as a clone of Bug #798348 +++

In order to simplify the track of the bug #798348, where a partial solution where submitted, I cloned the old bug into this one.

Symptoms (tested on a Lenovo x230):

  - After the stage2 installation process, the system has network (traditional mode). I can ping outside using a wire.
  - systemctl status NetworkManager.service says that the service is enabled but inactive.
  - YaST2 / Network Settings says that networks is controlled by NetworkManager.
  - After a reboot, Network Manager runs ok, and I can configure WiFi networks and Wire networks as usual.

Find attached the YaST2 logs.
Comment 1 Bin Li 2013-03-07 14:36:11 UTC
Alberto,

 I also met this issue after install RC2, I don't why the NetworkManager.service is disabled, when I enable it, then reboot, all works fine.

# systemctl status NetworkManager
NetworkManager.service - Network Manager
          Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; disabled)
          Active: inactive (dead)
          CGroup: name=systemd:/system/NetworkManager.service


# systemctl enable NetworkManager.service
ln -s '/usr/lib/systemd/system/NetworkManager.service' '/etc/systemd/system/network.service'
ln -s '/usr/lib/systemd/system/NetworkManager.service' '/etc/systemd/system/multi-user.target.wants/NetworkManager.service'
ln -s '/usr/lib/systemd/system/NetworkManager-wait-online.service' '/etc/systemd/system/network.target.wants/NetworkManager-wait-online.service'
Comment 2 Freek de Kruijf 2013-03-08 12:34:20 UTC
Tested with a new installation in VirtualBox. This ends up with a working traditional network just before ending the installation by YaST. When I finish the installation I observe a stop of network.service, which does not get restarted. I observe the window manager get started on tty8 and I login on tty2 to find the network not started. I can start the network or reboot the system after which all is as expected. So the solution seems to be that YaST stops the network.service, but also should restart the network.service in the status YaST configured, either traditional with ifup or using NetworkManager.

The last message from YaST in /var/log/YaST/y2log is at 11:47:49.
The messages after this time in /var/log/messages are: 11:47:2013-03-08T11:47:52.192809+01:00 linux rcnetwork[28992]: redirecting to "systemctl --ignore-dependencies stop network.service"
2013-03-08T11:47:52.198090+01:00 linux systemd[1]: Stopping LSB: Configure network interfaces and set up routing...
2013-03-08T11:47:52.956252+01:00 linux network[29007]: Shutting down network interfaces:
2013-03-08T11:47:53.082075+01:00 linux network[29007]: eth0      device: Intel Corporation 82540EM Gigabit Ethernet Co
2013-03-08T11:47:53.083751+01:00 linux ifdown[29360]:     eth0      device: Intel Corporation 82540EM Gigabit Ethernet Co
2013-03-08T11:47:53.268110+01:00 linux dhcpcd[29431]: eth0: sending signal 15 to pid 3862
2013-03-08T11:47:53.272949+01:00 linux dhcpcd[29431]: eth0: exiting
2013-03-08T11:47:53.272989+01:00 linux dhcpcd[3862]: eth0: received SIGTERM, stopping
2013-03-08T11:47:53.272998+01:00 linux dhcpcd[3862]: eth0: removing default route via 192.168.1.254 metric 0
2013-03-08T11:47:53.273005+01:00 linux dhcpcd[3862]: eth0: removing IP address 192.168.1.91/24
2013-03-08T11:47:53.273139+01:00 linux avahi-daemon[395]: Withdrawing address record for 192.168.1.91 on eth0.
2013-03-08T11:47:53.273772+01:00 linux avahi-daemon[395]: Leaving mDNS multicast group on interface eth0.IPv4 with address 192.168.1.91.
2013-03-08T11:47:53.275205+01:00 linux avahi-daemon[395]: Interface eth0.IPv4 no longer relevant for mDNS.
2013-03-08T11:47:53.604504+01:00 linux dhcpcd[3862]: eth0: exiting
2013-03-08T11:47:54.458141+01:00 linux avahi-daemon[395]: Interface eth0.IPv6 no longer relevant for mDNS.
2013-03-08T11:47:54.458170+01:00 linux avahi-daemon[395]: Leaving mDNS multicast group on interface eth0.IPv6 with address 2001:980:64c7:1:c4c0:f8d6:31bf:1145.
2013-03-08T11:47:54.458178+01:00 linux avahi-daemon[395]: Withdrawing address record for 2001:980:64c7:1:a00:27ff:fe86:a4fb on eth0.
2013-03-08T11:47:54.458693+01:00 linux avahi-daemon[395]: Withdrawing address record for 2001:980:64c7:1:c4c0:f8d6:31bf:1145 on eth0.
2013-03-08T11:47:55.317500+01:00 linux network[29007]: ..doneShutting down service network  .  .  .  .  .  .  .  .  .  .  .  ...done
2013-03-08T11:47:55.324127+01:00 linux systemd[1]: Stopped LSB: Configure network interfaces and set up routing.
2013-03-08T11:47:55.430523+01:00 linux systemd[1]: Started YaST2 Second Stage.
2013-03-08T11:47:55.432174+01:00 linux systemd[1]: Started YaST2 Firstboot.
2013-03-08T11:47:55.432192+01:00 linux systemd[1]: Starting SuSEfirewall2 phase 1...
2013-03-08T11:47:55.441004+01:00 linux systemd[1]: Started SuSEfirewall2 phase 1.
2013-03-08T11:47:55.442662+01:00 linux systemd[1]: Starting LSB: X Display Manager...
2013-03-08T11:47:55.448287+01:00 linux systemd[1]: Starting Getty on tty1...
2013-03-08T11:47:55.471081+01:00 linux systemd[1]: Started Getty on tty1.
2013-03-08T11:47:55.471110+01:00 linux systemd[1]: Starting Login Prompts.
2013-03-08T11:47:55.471117+01:00 linux systemd[1]: Reached target Login Prompts.
2013-03-08T11:47:55.471122+01:00 linux systemd[1]: Starting Multi-User.
2013-03-08T11:47:55.471716+01:00 linux systemd[1]: Reached target Multi-User.
2013-03-08T11:47:55.536731+01:00 linux SuSEfirewall2: Firewall rules set to CLOSE.
2013-03-08T11:47:55.617111+01:00 linux xdm[29720]: Starting service kdm..done
2013-03-08T11:47:55.620113+01:00 linux systemd[1]: Started LSB: X Display Manager.

So first the network is stopped by process-id 29007 after which systemd, process-id=1 starts some services apparently not the network.service.
Comment 3 Michal Filka 2013-03-11 09:41:42 UTC
I think, I've seen an answer for following question already somewhere in discussion, but I want to be sure, so I'm going to ask again.

Currently network starts links using "ip link set <dev> up" cmd. Is it problem for systemd? E.g. that systemd is not able to restart network properly in such case ...
Comment 4 Marius Tomaschewski 2013-03-11 12:01:48 UTC
(In reply to comment #3)
> I think, I've seen an answer for following question already somewhere in
> discussion, but I want to be sure, so I'm going to ask again.
> 
> Currently network starts links using "ip link set <dev> up" cmd. Is it problem
> for systemd? E.g. that systemd is not able to restart network properly in such
> case ...

I don't understand / can't follow. What do you mean exactly?
Why do you think "ip link set <dev> up" cmd could break systemd?


/etc/init.d/network [when in use] calls "ifup", which calls diverse "ip"
commands (ip link, ip addr, ip route) which are using netlink interface
to do their work and may also start other programs, e.g. dhcp client.

/etc/init.d/network redirects all direct/manual calls to systemd, which
calls the current network.service (that may be also NetworkManager).

When /etc/init.d/network is used, systemd calls its again from PID 0 and
inside of the network.service cgroup, that is all programs are started
there are running inside of this cgroup.

On 12.3, also all direct/manual calls to "ifup" are starting everything
in the network.service cgroup. Further ifup also rejects to do anything
when network.service resolves to another service, e.g. NetworkManager.


The problem from comment 2 happens IMO, because in the 2nd stage makes:

* /usr/lib/YaST2/startup/Second-Stage/S07-medium:

  Y2_NETWORK_ACTIVE=0
  rcnetwork start && Y2_NETWORK_ACTIVE=1

  -> when network is already started before, Y2_NETWORK_ACTIVE=1 is set!

then yast2-network is started, which may stop, switch to NetworkManager
(needs recent yast2, see bug 798348 comment 43 and bug 800771) and start
the (new) service at the end.
So basically, network is still up [when nothing fails] after yast2-network.

But it gets stopped by the 2nd stage scripts:

* /usr/lib/YaST2/startup/Second-Stage/S09-cleanup

  if test ! -z "$Y2_NETWORK_ACTIVE" ; then
    rcnetwork stop
  fi

  --> stop network at the end when Y2_NETWORK_ACTIVE != ""
      that is, it stops it always !!!
Comment 5 Marius Tomaschewski 2013-03-11 12:03:27 UTC
Michal,

could you please fix the 2nd stage fixes or reassign it to the proper person?
Comment 6 Marius Tomaschewski 2013-03-11 12:03:59 UTC
(In reply to comment #5)
> Michal,
> 
> could you please fix the 2nd stage fixes or reassign it to the proper person?
                       ... 2nd stage scripts ...
Comment 7 Michal Filka 2013-03-11 16:00:53 UTC
Marius: I've looked into it. It seems that the code is more than 8 years old. So, I'm curious what is the change which makes troubles. The way how is NetworkManager started?
Comment 8 Michal Filka 2013-03-11 16:09:37 UTC
Marius: second question. rcnetwork start is called with -o onboot option. Is it ok for systemd?
Comment 9 Jiří Suchomel 2013-03-12 07:47:39 UTC
(In reply to comment #4)

> But it gets stopped by the 2nd stage scripts:
> 
> * /usr/lib/YaST2/startup/Second-Stage/S09-cleanup
> 
>   if test ! -z "$Y2_NETWORK_ACTIVE" ; then
>     rcnetwork stop
>   fi
> 
>   --> stop network at the end when Y2_NETWORK_ACTIVE != ""
>       that is, it stops it always !!!

Looks like before systemd (and even before 12.3), many services (like network) were started after YaST 2nd stage. Arvin, do you remember about this part of start up scripts?
Comment 10 Michal Filka 2013-03-12 08:06:34 UTC
Hm, I've looked into y2start.log on freshly installed OpenSUSE 12.3 and it seems that network is not activated in S07-media. The script ends with 

Y2_NETWORK_ACTIVE = 0

However, rcnetwork stop is called in S09-cleanup.
Comment 11 Michal Filka 2013-03-12 08:20:27 UTC
Another note:

70-persistent-net.rules

is empty on freshly installed opensuse 12.3
Comment 12 Marius Tomaschewski 2013-03-12 11:53:17 UTC
(In reply to comment #7)
> Marius: I've looked into it. It seems that the code is more than 8 years old.
> So, I'm curious what is the change which makes troubles. The way how is
> NetworkManager started?

A "systemctl --force enable NetworkManager.service" enables NM and disables
ifup by creating /etc/systemd/system/network.service -> NetworkManager.service
alias link and all the ./multi-user.target.wants/* links adding it to runlevels.
A "disable NetworkManager.service" reverts it (removes the links). Don't forget to stop network before enabled/disable.

(In reply to comment #8)
> Marius: second question. rcnetwork start is called with -o onboot option. Is it
> ok for systemd?

Since 12.3 yes. /etc/init.d/network isn't using rc.status redirection, but makes
it itself. The -o onboot is ignored [always set under systemd].
Comment 13 Marius Tomaschewski 2013-03-12 11:58:15 UTC
(In reply to comment #11)
> Another note:
> 
> 70-persistent-net.rules
> 
> is empty on freshly installed opensuse 12.3

This IMO worth of an another bug: something for Frederic (udev maintainer).
The persistent net generator has been removed, biosdevname either does not
work [on my Dell OptiPlex 960, smbios 2.5] or is unreliable [Dell OptiPlex
990] and generates different names from version to version [SLE-11-SP2 & 3
at least].

When there is a rule, it is used. BTW: Persistent names are mandatory for
sysconfig.
Comment 14 Forgotten User xRcrmyYBVX 2013-03-12 14:27:45 UTC
(In reply to comment #9)
> Looks like before systemd (and even before 12.3), many services (like network)
> were started after YaST 2nd stage. Arvin, do you remember about this part of
> start up scripts?

Running a "systemctl isolate default.target" after installation starts network.service again.

Such a call was added to AutoYast in bug #769924, maybe this is needed in general (not only for autoyast) after finishing stage2?
Comment 15 Michal Filka 2013-03-12 14:39:29 UTC
Solution seems to be:
(1) fix condition in S09-cleanup script mentioned in Comment#4
(2) replace rcnetwork stop using rcnetwork restart

I've tested above fix for DVD installation and it works. I'm testing ssh installation just now.
Comment 16 Michal Filka 2013-03-13 13:38:45 UTC
Fix which works for normal installation from DVD.
https://github.com/yast/yast-installation/pull/28

SSH installation has minor bug. It doesn't switch to NetworkManager and uses ifup instead. This should be fixed in yast2-network - I'm working on it now.
Comment 17 Michal Filka 2013-03-13 13:52:22 UTC
Coolo: should be updated yast2-install package for OpenSUSE 12.3 or update it in Factory only?
Comment 18 Jiří Suchomel 2013-03-13 13:54:37 UTC
(In reply to comment #17)
> Coolo: should be updated yast2-install package for OpenSUSE 12.3 or update it
> in Factory only?

If new package is installed during 2nd stage's online update step, it would replace S09-cleanup script before its execution

But most users don't use interactive 2nd stage at all, so it wouldn't help them...
Comment 19 Forgotten User xRcrmyYBVX 2013-03-13 13:59:52 UTC
I am doing AutoYast installations of openSUSE 12.3 and am affected by this bug, hence I need to work around it in a 12.3-specific init script (to start the network after stage2).

If a patch would be released for 12.3, stage1 would install the updated package and stage2 would work again, thus making my workaround obsolete.

So I would greatly appreciate an update for 12.3!
Comment 20 Michal Filka 2013-03-19 05:57:52 UTC
*** Bug 803422 has been marked as a duplicate of this bug. ***
Comment 21 Jiří Suchomel 2013-03-19 07:40:05 UTC
Maintenance request:

https://build.opensuse.org/request/show/159916
Comment 22 Benjamin Brunner 2013-03-19 11:10:03 UTC
Thanks for your submission. I started an update. See openSUSE:Maintenance:1465.
Comment 23 Jiří Suchomel 2013-03-19 11:21:34 UTC
Michal, does it make sense to release this update without those in dependency list?
Comment 24 Michal Filka 2013-03-19 12:58:26 UTC
yes. I suppose that bnc#798348 is fixed. bnc#800365 is related to ssh install only. I've had no problem with this issue during dvd installation.
Comment 25 Jiří Suchomel 2013-03-19 13:35:29 UTC
So, could you clean up the dependencies? If this one does not really depend on other ones, it could be closed (and maintenance released).

BTW, which way is bnc#798348 fixed? Are you releasing update as well?
Comment 26 Arvin Schnell 2013-03-25 16:15:09 UTC
*** Bug 802956 has been marked as a duplicate of this bug. ***
Comment 27 Benjamin Brunner 2013-03-26 11:24:24 UTC
Update released for openSUSE 12.3. Feel free to close the bug as soon as the dependencies are cleaned up.
Comment 28 Swamp Workflow Management 2013-03-26 12:04:53 UTC
openSUSE-RU-2013:0537-1: An update that has two recommended fixes can now be installed.

Category: recommended (low)
Bug References: 806454,808039
CVE References: 
Sources used:
openSUSE 12.3 (src):    yast2-installation-2.23.13-1.4.3
Comment 29 Michal Filka 2013-06-10 00:42:06 UTC
*** Bug 808320 has been marked as a duplicate of this bug. ***
Comment 30 Johannes Weberhofer 2014-09-19 10:44:46 UTC
Can this ticket be closed?
Comment 31 Forgotten User 5jFyFBvk-I 2014-09-19 11:25:05 UTC
Yes