Bug 798348

Summary: No network without networkmanager
Product: [openSUSE] openSUSE 12.3 Reporter: Stephan Kulow <coolo>
Component: NetworkAssignee: Michal Filka <mfilka>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Major    
Priority: P2 - High CC: aj, fcrozat, forgotten_5jFyFBvk-I, freek, jweberhofer, kkaempf, locilka, mfilka, mt, mvidner, paul.zirnik, rb03884, ro, szotsaki, wstephenson
Version: RC 2Flags: wstephenson: SHIP_STOPPER? (coolo)
Target Milestone: Final   
Hardware: Other   
OS: Other   
See Also: https://bugzilla.novell.com/show_bug.cgi?id=764055
Whiteboard: GOLD
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Bug Depends on:    
Bug Blocks: 808039    
Attachments: Network started manually by some yast2 scripts
yast2: prototype patch to use network.service instead NETWORKMANAGER
yast2-network: prototype patch to use network.service instead NETWORKMANAGER
yast2: prototype patch to use network.service instead NETWORKMANAGER
network-service-switch.sh: illustration script
yast2-2.23.19: merged prototype patch to use network.service instead NETWORKMANAGER
yast2-network-2.24.12: merged prototype patch to use network.service instead NETWORKMANAGER
YaST2 log for a Lenovo x230 after installation

Description Stephan Kulow 2013-01-14 14:28:00 UTC
I just installed a recent Beta1 build in kvm and got no networkmanager (so far so good). But I didn't get any network either.

linux-op4k:/home/col # /etc/init.d/network status
Checking mandatory network interfaces:                                                                                                                                              
    lo                                                                                                                                                                              
              IP address: 127.0.0.1/8                                                                                                                                               
    lo        is up                                                                                                                                                      running    
    eth0      device: Realtek Semiconductor Co., Ltd. RTL-8139/8139                                                                                                                 
    eth0      DHCP4 client NOT running                                                                                                                                              
    eth0      DHCP6 client NOT running                                                                                                                                              
    eth0      is up                                                                                                                                                      unused
    lo        
              IP address: 127.0.0.1/8
    lo        is up                                                                                                                                                      running
Checking service network .  .  .  .  .  .  .  .  .  .  .                                                                                                                 unused
network.service - LSB: Configure the localfs depending network interfaces
          Loaded: loaded (/etc/init.d/network)
          Active: inactive (dead)
          CGroup: name=systemd:/system/network.service

Jan 14 14:46:27 linux-op4k systemd[1]: Stopped LSB: Configure the localfs depending network interfaces.
linux-op4k:/home/col # ifup eth0
    eth0      device: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 20)
Starting DHCP4+DHCP6 client on eth0. . . . . . . .  
    eth0      IP address: 10.0.2.15/24
    eth0      DHCP6 continues in background
Comment 1 Marius Tomaschewski 2013-01-14 15:29:00 UTC
Going to install the most recent factory from scratch... and take a look
what happens there exactly. I guess, it is the NM <-> ifup switch, that
does not work properly any more...

BTW: Do not use "ifup" directly -- systemd will currently never consider
manually started interfaces as part of the network service (it is on my
TODO to bring him to consider them) as they're not part of the cgroup.

Use "rcnetwork stop ; rcnetwork start".

See also sysconfig & NetworkManager in $OBS/home:mtomaschewski:tests/.
Comment 2 Stephan Kulow 2013-01-14 16:00:38 UTC
on 2nd boot network is there
Comment 3 Marius Tomaschewski 2013-01-14 17:20:45 UTC
Created attachment 520129 [details]
Network started manually by some yast2 scripts

I've installed just now and have a bit different view: The network is up
and running, but systemd does not know anything about.

I guess this is caused by "rcnetwork start -o onboot" in the
   /usr/lib/YaST2/startup/Second-Stage/S07-medium
script or something similar:

when there are additional arguments except of the init script action
(such as the "-o onboot" above), the call is not redirected to systemd
via /etc/rc.status redirection and the network is started "directly",
not via systemd, where it is still in any "not started" state.
Comment 4 Marius Tomaschewski 2013-01-15 15:43:35 UTC
Any news from NETWORKMANAGER -> network.service adoption of yast2?
Comment 5 Marius Tomaschewski 2013-01-17 15:49:42 UTC
Created attachment 520659 [details]
yast2: prototype patch to use network.service instead NETWORKMANAGER
Comment 6 Marius Tomaschewski 2013-01-17 15:50:19 UTC
Created attachment 520661 [details]
yast2-network: prototype patch to use network.service instead NETWORKMANAGER
Comment 7 Marius Tomaschewski 2013-01-17 15:57:25 UTC
The patches also workarounds one insufficient fix for bnc#795929 problem
with yast2's Service::Status implementation:

 -> Adding the directory checkExists's dir list is not sufficient.

This check IMO still breaks e.g. network service (/etc/init.d/network).
Call to Service::Status("network") is always -1 because of checkExists,
because there is no network.service file.

I'd say, just remove checkExists line from Service::Status().
Comment 8 Marius Tomaschewski 2013-01-17 16:04:14 UTC
Created attachment 520665 [details]
yast2: prototype patch to use network.service instead NETWORKMANAGER

Ahm... wrong function order: moved use behind declaration...
Comment 9 Marius Tomaschewski 2013-01-17 16:07:02 UTC
Michal, Lukas,

see prototype patches. Please note also comment 3.
Comment 10 Marius Tomaschewski 2013-01-17 16:13:08 UTC
See also the test packages in:

http://download.opensuse.org/repositories/home:/mtomaschewski:/tests/

yast2-network test suite currently fails -- AFAIS because of the checkExists:

Let me know when you have the yast2 packages ready.
Comment 11 Marius Tomaschewski 2013-01-17 16:15:09 UTC
Created attachment 520666 [details]
network-service-switch.sh: illustration script
Comment 12 Lukas Ocilka 2013-01-18 14:02:41 UTC
The patch is not bad but I have some comments:

* First of all, we use GitHub now, where cloning and creating pull requests
  make it easier for us to incorporate changes from different authors
  easily - this also makes it easy to comment the change

* Some pieces changes or even parts of the diff belong to Service YCP module
  instead of NetworkService - they are quite generic or at least could be
  For instance Service::RunInitScript() could be used or even extended
  ("--no-pager -p Id show" as a param)

* Functions like GetServiceId or GetUnitId definitely belong to Service module

* Additionally, testsuite is missing
Comment 13 Marius Tomaschewski 2013-01-23 12:06:26 UTC
Created attachment 521559 [details]
yast2-2.23.19: merged prototype patch to use network.service instead NETWORKMANAGER
Comment 14 Marius Tomaschewski 2013-01-23 12:07:36 UTC
Created attachment 521560 [details]
yast2-network-2.24.12: merged prototype patch to use network.service instead NETWORKMANAGER
Comment 15 Marius Tomaschewski 2013-01-23 13:01:13 UTC
(In reply to comment #12)
> The patch is not bad but I have some comments:

Sure. I'm completely not familiar with all the yast2 mechanisms.

> * First of all, we use GitHub now, where cloning and creating pull requests
>   make it easier for us to incorporate changes from different authors
>   easily - this also makes it easy to comment the change

OK, done.
I've splitted the yast2 patch into two separate commits (for Service
only and for NetworkService changes) and created github pull requests:

https://github.com/yast/yast-yast2/pull/44
https://github.com/yast/yast-network/pull/47

> * Some pieces changes or even parts of the diff belong to Service YCP module
>   instead of NetworkService - they are quite generic or at least could be
>   For instance Service::RunInitScript() could be used or even extended
>   ("--no-pager -p Id show" as a param)

I didn't wanted to break other services. AFAIS NetworkService reimplements
e.g. an own RunInitScript anyway, so there were things to cleanup already
before.

> * Functions like GetServiceId or GetUnitId definitely belong to Service module

They are in Service.

> * Additionally, testsuite is missing

Yes, but I've no idea how to make it the right way.

So the testsuites and cleanup or "making it the right way" remains as
TODO for the Authors / yast2-maintainers.

I'm going to retest & submit the other packages now.
Comment 16 Marius Tomaschewski 2013-01-24 17:49:06 UTC
See bnc#800365, a systemd queue-merge bug, which breaks the network
start inside of the yast2 2nd stage scripts, because systemd merges
the start calls with the network.service start which is scheduled
to start after the 2nd stage.
Comment 17 Marius Tomaschewski 2013-01-24 18:13:07 UTC
Except of the systemd bnc#800365 issue, the home:mtomaschewski:tests
packages work fine for me, that is in a running system and at boot
[without all the (re)starts in 2nd stage].
Comment 18 Bernhard Wiedemann 2013-01-24 20:00:22 UTC
This is an autogenerated message for OBS integration:
This bug (798348) was mentioned in
https://build.opensuse.org/request/show/149829 Factory / sysconfig
https://build.opensuse.org/request/show/149830 Factory / sysconfig
Comment 19 Bernhard Wiedemann 2013-01-25 10:00:08 UTC
This is an autogenerated message for OBS integration:
This bug (798348) was mentioned in
https://build.opensuse.org/request/show/149901 Factory / netcontrol
Comment 20 Bernhard Wiedemann 2013-01-28 14:00:27 UTC
This is an autogenerated message for OBS integration:
This bug (798348) was mentioned in
https://build.opensuse.org/request/show/150166 Factory / sysconfig
https://build.opensuse.org/request/show/150169 Factory / sysconfig
Comment 21 Stephan Kulow 2013-01-28 14:16:14 UTC
please note that kiwi-config-openSUSE sets NETWORKMANGER=yes for the live cds. This needs changes too.
Comment 22 Bernhard Wiedemann 2013-01-29 09:01:26 UTC
This is an autogenerated message for OBS integration:
This bug (798348) was mentioned in
https://build.opensuse.org/request/show/150265 Factory / NetworkManager
Comment 23 Marius Tomaschewski 2013-01-31 15:15:42 UTC
(In reply to comment #21)
> please note that kiwi-config-openSUSE sets NETWORKMANGER=yes for the live cds.
> This needs changes too.

=> bnc#800817.
Comment 24 Marius Tomaschewski 2013-01-31 16:19:56 UTC
Michal, Lukas, any news about:

https://github.com/yast/yast-yast2/pull/44
https://github.com/yast/yast-network/pull/47
Comment 25 Marius Tomaschewski 2013-02-18 13:49:34 UTC
*** Bug 803521 has been marked as a duplicate of this bug. ***
Comment 26 Marius Tomaschewski 2013-02-18 13:50:35 UTC
*** Bug 801994 has been marked as a duplicate of this bug. ***
Comment 27 Marius Tomaschewski 2013-02-18 13:51:22 UTC
*** Bug 802761 has been marked as a duplicate of this bug. ***
Comment 28 Marius Tomaschewski 2013-02-19 16:12:21 UTC
*** Bug 803008 has been marked as a duplicate of this bug. ***
Comment 29 Andreas Jaeger 2013-02-19 18:49:42 UTC
Marius, it seems to me that you do not handle the update correctly. When updating with NetworkManager running, you then have network.service enabled instead of NetworkManager.service. At least that's my understanding after updating my systems and also after reading some of the duplicated bug reports.
Comment 30 Marius Tomaschewski 2013-02-19 19:33:39 UTC
(In reply to comment #29)
> Marius, it seems to me that you do not handle the update correctly. When
> updating with NetworkManager running, you then have network.service enabled
> instead of NetworkManager.service. At least that's my understanding after
> updating my systems and also after reading some of the duplicated bug reports.

Yes, update is not working correctly too :-/

bug 803058: tracks the update case [where yast2 2nd stage is not involved,
bug 798348: [this one] is about fresh installations with yast2 switch.

BTW: network.service is basically always enabled (via insserv rcnetwork).
When also NetworkManager.service is enabled, it creates network.service
alias link which masks /etc/init.d/network. Unfortunately this does not
work properly on update (I hope home:mtomaschewski:test packages fix it).
Comment 31 Will Stephenson 2013-02-25 16:40:04 UTC
Always enabling network.service but hiding it with a symlink sounds hacky.  Is there a better way that arranges both services as exclusive alternatives?
Comment 32 Frederic Crozat 2013-02-25 16:47:23 UTC
using symlink to shadow a service is part of systemd (in fact, it is just a derivative of the way systemd merged configuration in /usr/lib/systemd + /etc/system/system + /run/systemd/ ), so it isn't as hacky as it seems :)
Comment 33 Freek de Kruijf 2013-03-01 20:25:06 UTC
After some digging in the log file /var/log/y2log I found the error which causes the problem of not changing the network.service from pointing to NetworkManager.service or just to itself (/etc/init.d/network).

When only changing from Traditional to NetworkManager the network module of YaST sets this in the configuration and issues a "/bin/systemctl reload network.service" which does not work. The error message is "Job type reload is not applicable for unit network.service". YaST does not issue an error message to the user. So this error gets unnoticed.

For the maintainer: Line 570 in modules/Lan.ycp needs a more complicated treatment. Now it just reads:
              Service::Reload("network");
without any error checking.
Comment 34 Klaus Kämpf 2013-03-02 16:01:21 UTC
Just for the record: 'zypper dup' to 12.3 RC2 still leaves default route on eth0 instead of br0. Only manual switch from NetworkManager.service to network.service + reboot fixes this.
Comment 35 Freek de Kruijf 2013-03-02 19:02:37 UTC
AFAIK configuration in YaST without NetworkManager is not copied to the NetworkManager configuration when you switch to NetworkManager method. So switching means you have to configure the network from the bare basics.
Comment 36 Will Stephenson 2013-03-04 15:41:36 UTC
This is the situation as of Build97 (post RC2) DVD install
Post installation, first boot, networking is not active
On second boot or after rcnetwork restart, traditional network is enabled and active.  

yast2 lan: "User controlled with NetworkManager" is checked, but NetworkManager is not running (systemctl status NetworkManager -> loaded, disabled, inactive).

Changing networking type with yast2 lan has no effect. 

What does work is 

systemctl stop network.service
systemctl enable NetworkManager.service (this creates the symlink network.service masking /etc/init.d/network)
systemctl --system daemon-reload (so systemd knows about the new masking)
systemctl start NetworkManager.service

This 
Summary is, with a DVD install you need to know this incantation to get NM and therefore useful networking on a laptop. We might as well call the DVD "Workstation edition" and make a positive out of this.
Comment 37 Will Stephenson 2013-03-04 16:11:56 UTC
Coolo, I hope it's clear now how this is worse than in 12.2 DVD...
Comment 38 Freek de Kruijf 2013-03-04 16:38:34 UTC
The problem is a call "systemctl reload network.service" which does not work (at least when NetworkManager is active, if not al all) and should be replaced by the above commands depending on which switch between Traditional and NetworkManager should be performed. I already suggested a solution on yast-devel@opensuse.org.
Comment 39 Martin Vidner 2013-03-05 16:02:33 UTC
I have tested with Marius' code from comment 24 (merged with other changes made in the meantime):
https://github.com/mvidner/yast-yast2/commit/066d0e32d35af14938d40d9939827e944d28310f
https://github.com/mvidner/yast-network/commit/38ebc06f8e6f0ec62198ab4c96874438a77ca482
(submitted them to https://build.opensuse.org/project/show?project=YaST%3AHead )

and the *original* bug, about network not coming up after a DVD installation without NetworkManager, is not fixed. Digging in.
Comment 40 Martin Vidner 2013-03-05 16:33:28 UTC
/usr/lib/YaST2/startup/Second-Stage/S09-cleanup stops the network.

Frederic, did you mean to address that in https://github.com/fcrozat/yast-installation/commit/6b317d27cbeba2c7368fda15dc6cba00464e5a57 ? (bug 800365 Comment 5)
Comment 41 Frederic Crozat 2013-03-05 16:43:17 UTC
(In reply to comment #40)
> /usr/lib/YaST2/startup/Second-Stage/S09-cleanup stops the network.
> 
> Frederic, did you mean to address that in
> https://github.com/fcrozat/yast-installation/commit/6b317d27cbeba2c7368fda15dc6cba00464e5a57
> ? (bug 800365 Comment 5)

Yes, YaST second stage shouldn't touch network at all (but there were other issues I couldn't debug). And it is way to late to change that for 12.3 now. But if we can clean up this for Factory, I'd be happy.
Comment 42 Alberto Planas Dominguez 2013-03-06 08:07:55 UTC
Created attachment 528381 [details]
YaST2 log for a Lenovo x230 after installation

I tested yast2-2.23.22-0.x86_64.rpm and yast2-network-2.24.16-0.x86_64.rpm (build locally). The test platform is a Lenovo x230 laptop.

I installed both RPMs before stage2 installation process, and after the installation process I have network in the traditional mode (I can ping random URLs). A systemctl status NetworkManager.service show that the service is enabled but inactive. After the first reboot, the Network Manager is running perfectly. Also, I tested that I can switch between traditional and NM mode.

Really cool.
Comment 43 Martin Vidner 2013-03-06 09:33:17 UTC
yast2-2.23.22 and yast2-network-2.24.16 are in https://build.opensuse.org/project/show?project=openSUSE%3A12.3 already.
Merged to master git repos:  https://github.com/yast/yast-network/pull/61 and https://github.com/yast/yast-yast2/pull/51

Note that this only fixes the netcontrol - NetworkManager switch being network.service instead of NETWORKMANAGER=yes. The original report of network not being up after a DVD install is still valid.

Back to Michal.
Comment 44 Forgotten User 5jFyFBvk-I 2013-03-06 10:25:35 UTC
I too have a problem with Networkmanager not starting at all, and therefore don't have any network :-(
I manage it using yast lan each time I want to connect to a network.

If I checkthe user networkmanager and try to enable it in KDE, no network appears in NetworkManager-kde :-(
Comment 45 Marius Tomaschewski 2013-03-06 12:32:24 UTC
(In reply to comment #44)
> I too have a problem with Networkmanager not starting at all, and therefore
> don't have any network :-(
> I manage it using yast lan each time I want to connect to a network.
> 
> If I checkthe user networkmanager and try to enable it in KDE, no network
> appears in NetworkManager-kde :-(

Until the yast2 changes (comment 43), which are required to switch between /etc/init.d/network and NetworkManager.service are available in install or
update repositories, use the following commands as root:

systemctl stop network.service
systemctl --force enable NetworkManager.service
systemctl start network.service

See bug #800771 for more details.
Comment 46 Forgotten User 5jFyFBvk-I 2013-03-06 12:37:21 UTC
And yes, that fixed it for me :-) 
How amazing is this. Report issue, couple of hours later there is a reply with a viable sollution. Love openSuse
Comment 47 Marius Tomaschewski 2013-03-06 12:56:44 UTC
(In reply to comment #40)
> /usr/lib/YaST2/startup/Second-Stage/S09-cleanup stops the network.

Exactly. See also bug#800365, which is already set as dependency of this bug.

The 2nd stage is first trying to start network (without a check if the network
were already running before or not) in S07-medium and sets a mark to stop it
in S09-cleanup.

Then yast2-network is started, which proposes some network configuration,
that may switch to use NetworkManager [works since changes in comment 43]
and restarts it at the end when possible (e.g. skipped in ssh-mode install).

Finally, S09-cleanup stops the network (due to the mark).

These start/stop requests either collide with the enqueued regular start
job in systemd (and may cause a systemd deadlock in case when the network
is enqueued to start after 2nd stage) or _cancel_ the job (network start
before 2nd stage; see patches by Frederic).
Comment 48 Will Stephenson 2013-03-06 13:54:43 UTC
Have just tested Build107 DVD x86_64 incorporating Martin's fixed yast2 and yast2-network.

Good: It is now possible to enable NetworkManager in the installed system using yast lan.

Bad: In the first boot of the installed system, the initial value of the Network Setup Method radiobutton is still 'User Controlled with NetworkManager', when actually the traditional ifup method was started.

So as Marius says in c47 ^, on initial boot of the installed system things are horked, and a further reboot (or force stop-start) is needed to get NM to come up as configured.
Comment 49 Marius Tomaschewski 2013-03-07 07:48:21 UTC
*** Bug 807018 has been marked as a duplicate of this bug. ***
Comment 50 Marius Tomaschewski 2013-03-07 08:05:14 UTC
*** Bug 806959 has been marked as a duplicate of this bug. ***
Comment 52 Bernhard Wiedemann 2013-03-27 17:00:11 UTC
This is an autogenerated message for OBS integration:
This bug (798348) was mentioned in
https://build.opensuse.org/request/show/161466 Maintenance / 
https://build.opensuse.org/request/show/161467 Maintenance /
Comment 53 Swamp Workflow Management 2013-04-03 13:05:15 UTC
openSUSE-RU-2013:0598-1: An update that has three recommended fixes can now be installed.

Category: recommended (low)
Bug References: 798348,810381,811002
CVE References: 
Sources used:
openSUSE 12.1 (src):    netcontrol-0.2.8-0.3.7.1
Comment 54 Swamp Workflow Management 2013-04-03 14:04:37 UTC
openSUSE-RU-2013:0598-2: An update that has three recommended fixes can now be installed.

Category: recommended (low)
Bug References: 798348,810381,811002
CVE References: 
Sources used:
openSUSE 12.2 (src):    netcontrol-0.2.8-0.6.8.1
Comment 55 Ákos Szőts 2013-05-23 21:29:11 UTC
I don't want urge you or something, but 2 and a half month after the final version released, I did a dist upgrade. After a restart I lost my connection to my server, no SSH, nothing.

It took me hours to find out what is the problem, until I found this report. I have no physical access to the server.

In YaST ifup is checked as the current solution but I see "NetworkManager" in the output of the command "ps -ef | grep -i network".

NM is buggy, but I don't care because I don't want to use it. Now I'm forced.

So I ask two things:
- how can I revert to ifup? Permanently.
- after three months, please fix this bug already! Thank you.
Comment 56 Ákos Szőts 2013-05-23 21:47:05 UTC
I found the answer how can I disable NM from the command line, without YaST:
https://www.suse.com/releasenotes/x86_64/openSUSE/12.3/#sec.123.systemd-nm
Comment 57 Martin Vidner 2013-09-27 10:51:14 UTC
Removing the dependency on bnc#800365 (systemd: rcnetwork start in YaST2-Second-Stage.service blocks), so that I can close this one. The dependency is not clear to me anyway.
Comment 58 Martin Vidner 2013-09-27 10:52:03 UTC
I have tested with 13.1 Beta 1:
- a KVM installation via virt-install, x86_64, DVD
- My choices: Automatic configuration, KDE, btrfs, local authentication, no fw, enable ssh
- NetworkManager was proposed to be installed, I deselected it.

When the system has booted to KDE, the interface does have a DHCP supplied address, and "yast2 lan" correctly shows "traditional" as General/Network Setup Method.