You are not logged in.

#1 2012-11-04 15:10:05

hilojack
Member
Registered: 2012-09-30
Posts: 7

[SOLVED]Network-Manager confilcts with net-auto-wireless

My network didn't work after I enabled NetworkManager.service

[hilo@hilo ~]$ sudo systemctl enable NetworkManager.service
ln -s '/usr/lib/systemd/system/NetworkManager.service' '/etc/systemd/system/dbus-org.freedesktop.NetworkManager.service'
ln -s '/usr/lib/systemd/system/NetworkManager.service' '/etc/systemd/system/multi-user.target.wants/NetworkManager.service'

I found Network-Manager.service confilcts with net-auto-wireless.service(it start a process which named wpa_supplicant)

[hilo@hilo ~]$ ps aux|grep -i network
root       313  0.0  0.0 250268  6916 ?        Ssl  01:14   0:01 /usr/sbin/NetworkManager --no-daemon
root       346  0.1  0.0  32152  1572 ?        Ss   01:14   0:00 wpa_supplicant -B -P /run/wpa_supplicant_wlan0.pid -i wlan0 -D nl80211,wext -c/run/network/wpa.wlan0/wpa.conf -W

The solution is to disable net-auto-wireless.service

[hilo@hilo ~]$ sudo  systemctl disable net-auto-wireless.service
[sudo] password for hilo: 
rm '/etc/systemd/system/multi-user.target.wants/net-auto-wireless.service'

=============
Note:
The new initscripts configuration  has been moved from rc.conf to systemd.--Refer to Systemd wiki
=============
Very grateful to all of you!

Last edited by hilojack (2012-11-06 16:20:23)

Offline

#2 2012-11-04 16:06:04

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,694

Re: [SOLVED]Network-Manager confilcts with net-auto-wireless

how do you figure they conflict? The stock service is NetworkManager or networkmanager, did you create a custom service? If you disable network.target, you're most likely going to screw up your network access completely. "network" in rc.conf has nothing to do at all with network.target.

Last edited by Scimmia (2012-11-04 16:07:03)

Online

#3 2012-11-04 19:43:18

adrianx
Member
From: South Africa
Registered: 2010-03-22
Posts: 70

Re: [SOLVED]Network-Manager confilcts with net-auto-wireless

I've had to do that too:

sudo ln -s /dev/null /etc/systemd/system/network.target

You can mask a service. This is like disabling a service, but on steroids. It not only makes sure that service is not started automatically anymore, but even ensures that a service cannot even be started manually anymore. This is a bit of a hidden feature in systemd, since it is not commonly useful and might be confusing the user. But here's how you do it:

source

Offline

#4 2012-11-04 22:48:55

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,489

Re: [SOLVED]Network-Manager confilcts with net-auto-wireless

Good that it works for you adrianx, but the question might be how that network.target configuration file got there to your custom /etc/systemd/system in the first place. You both seem to mix up nomenclatura of "target" and "service", as Scimmia was suggesting already. Have a look at man systemd.target or 
https://wiki.archlinux.org/index.php/Systemd#Targets
The packaged network.target is also mentioned on the wiki and in the faq.

Offline

#5 2012-11-05 16:43:24

hilojack
Member
Registered: 2012-09-30
Posts: 7

Re: [SOLVED]Network-Manager confilcts with net-auto-wireless

Scimmia wrote:

how do you figure they conflict? The stock service is NetworkManager or networkmanager, did you create a custom service? If you disable network.target, you're most likely going to screw up your network access completely. "network" in rc.conf has nothing to do at all with network.target.

I did not create any custom service.

[hilo@hilo ~]$ ps aux|grep -i network
root       313  0.0  0.0 250268  6916 ?        Ssl  01:14   0:01 /usr/sbin/NetworkManager --no-daemon
root       346  0.1  0.0  32152  1572 ?        Ss   01:14   0:00 wpa_supplicant -B -P /run/wpa_supplicant_wlan0.pid -i wlan0 -D nl80211,wext -c/run/network/wpa.wlan0/wpa.conf -W

[hilo@hilo ~]$sudo kill 346 #The network works well as soon as I kill wap_supplicant

I guess there is a place which has the wap_supplicant autostared.But I don't know where it is.

Strike0 wrote:

Good that it works for you adrianx, but the question might be how that network.target configuration file got there to your custom /etc/systemd/system in the first place. You both seem to mix up nomenclatura of "target" and "service", as Scimmia was suggesting already. Have a look at man systemd.target or 
https://wiki.archlinux.org/index.php/Systemd#Targets
The packaged network.target is also mentioned on the wiki and in the faq.

I'll have a look at it tommorw. Appreciate!

Last edited by hilojack (2012-11-06 16:08:29)

Offline

#6 2012-11-05 17:12:28

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [SOLVED]Network-Manager confilcts with net-auto-wireless

hilojack, you still haven't explained why you think networkmanager.service conflicts with network.target.

Strike0, if you read adrianx's link, you'll get a clearer idea of what he's doing. However, that document is over 18 months old - these days we have 'systemctl mask foo.bar' instead.

Offline

#7 2012-11-05 17:18:20

hilojack
Member
Registered: 2012-09-30
Posts: 7

Re: [SOLVED]Network-Manager confilcts with net-auto-wireless

tomk wrote:

hilojack, you still haven't explained why you think networkmanager.service conflicts with network.target.

Strike0, if you read adrianx's link, you'll get a clearer idea of what he's doing. However, that document is over 18 months old - these days we have 'systemctl mask foo.bar' instead.

Sorry.Somebody told me about that.It's my mistake.

Offline

#8 2012-11-05 17:52:40

Leonid.I
Member
From: Aethyr
Registered: 2009-03-22
Posts: 999

Re: [SOLVED]Network-Manager confilcts with net-auto-wireless

hilojack wrote:

I found that Network-Manager.service confilcts with network.target.
I don't know how to disable network(I have no file "/etc/rc.conf")

[hilo@hilo ~]$ sudo systemctl disable network.target #Why it still starts when laptop reboot?
[hilo@hilo ~]$ sudo systemctl enable network.target
The unit files have no [Install] section. They are not meant to be enabled using systemctl.

Many thanks for yr help!

Disabling network.target is pointless as it is not loaded automatically.

First, do not confuse network.target and network.service. network.target is a special unit used as a 'placeholder'. By itself it does absolutely nothing. A typical dependency graph is:

NM --> network.target --> daemon-which-needs-network.service

For instance, consider ntpd.service and netcfg.service. The former has After=network.target meaning that NTP will only start when network is available. However, the latter has Before=network.target. Thus, netcfg starts first, loads a profile, then network.target becomes available and ONLY then NTP starts.

I don't have NM but exactly the same must apply to it. Otherwise, there is a bug in NM.


Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd

Offline

#9 2012-11-06 16:00:59

hilojack
Member
Registered: 2012-09-30
Posts: 7

Re: [SOLVED]Network-Manager confilcts with net-auto-wireless

Oh,I totally misunderstand the netwrok.target(It is not network.service).
Happy to get the answer to this problem and very grateful to all of you!

Last edited by hilojack (2012-11-06 16:19:09)

Offline

Board footer

Powered by FluxBB