Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Applications crash when i'm connected to wifi
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
Fulgurance
Guru
Guru


Joined: 15 Feb 2017
Posts: 552

PostPosted: Mon Mar 27, 2017 10:14 pm    Post subject: Applications crash when i'm connected to wifi Reply with quote

Hello, I realized a big problem for a while. Usually I connected to the Internet with the Ethernet cable. I wanted to test the wifi connection with NetworkManager to see if it worked.

I connect without problem, however, when connected, I can not launch any application, it crash directly!

If I launch an application before being connected to wifi and then that I connect to wifi, the open application remains functional.

I wanted to run a command line application when I'm connected to wifi, and I get an error:
Code:
No protocol specified
Error: cannot open display: :0


Any idea ?
Back to top
View user's profile Send private message
cboldt
l33t
l33t


Joined: 24 Aug 2005
Posts: 829

PostPosted: Mon Mar 27, 2017 10:24 pm    Post subject: Reply with quote

Unable to open an application is not usually taken as being a "crash." A "crash" is a running applications stops running.

The way I interpret your report, what is happening is you are unable to launch of start any 'X' applications after you start or try to start wifi.

I suspect you have a messed up firewall, seriously messed up, after invoking NetworkManager to start wifi. Xwindows uses the network, even within a given machine. Blocking new X-related packed on interface 'lo' results in inability to open new X-windows applications.
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Mon Mar 27, 2017 11:39 pm    Post subject: Reply with quote

You miss the full output.

E.g.

Code:
roman@ASUS-G75VW ~ $ pwd
/home/roman


Full output contains: shell, user, host, command which was in use, and full output of command.

--

Network manager is very very bad.

Users fail to set up a connection because they do not really understand how it works.

I set up manually my boxes since forever. Even on windows, as even there the auto config does not really works. On the smartphone with open public wifi its the same game, it does not work out of the box.

NEVER use auto connection. You do not really know what is in use, where you are connected, how it works.

--

Wifi is a bit more complicated as wired lan.

An Owner of a network device should also properly configure that device too, btw. Just plugin the cable is not really advised in my opinion!

--

Quote:
If I launch an application before being connected to wifi and then that I connect to wifi, the open application remains functional.


A good question starts with a full detail description of what you did.
That also includes which platform, which software version, and any other data which may be needed.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 13485

PostPosted: Tue Mar 28, 2017 1:22 am    Post subject: Reply with quote

Command line applications do not need a working X server. If they did, they would be GUI applications, not command line applications. Please post the output of hostname as run both when you can start GUI applications and when you cannot.
Back to top
View user's profile Send private message
Fulgurance
Guru
Guru


Joined: 15 Feb 2017
Posts: 552

PostPosted: Tue Mar 28, 2017 1:34 pm    Post subject: Reply with quote

In fact, basically, I did not want to NetworkManager, I wanted to use wpa_supplicant.
Is it possible to add the wifi icon in the menu bar under plasma with wpa_supplicant?

Or is there a command line in an all-in-one program that manages ethernet and wifi and can interface with plasma?
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Tue Mar 28, 2017 5:35 pm    Post subject: Reply with quote

edit Just a hint, for the hidden question, how to get network going without the use of networkmanager, independend of the Desctop environment / X-Server /endedit

Code:
ASUS-G75VW roman # rc-update show|grep dhc
               dhcpcd |      default                                 
ASUS-G75VW roman # rc-update show|grep wpa
       wpa_supplicant |      default   


Works for wired and wireless. without networkmanager

Code:
ASUS-G75VW roman # qlist -Iv networkamanager dhcpcd wpa_supplicant
net-misc/dhcpcd-6.11.5
net-wireless/wpa_supplicant-2.6-r1


No Idea on the requirement for the kde desctop.

--

Except recently to create a new entry for a public wifi, to test if my setup can handle a public wifi, there is no need for user intervention.
Only need is to restart those two services when you adapt / add keys to wpa_supp...
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Tue Mar 28, 2017 6:32 pm    Post subject: Reply with quote

Fulgurance wrote:
In fact, basically, I did not want to NetworkManager, I wanted to use wpa_supplicant. Is it possible to add the wifi icon in the menu bar under plasma with wpa_supplicant?

Fulgurance ... have you tried adding the qt5 useflag to wpa_supplicant and running 'wpa_gui'?

Roman_Gruber wrote:
Only need is to restart those two services when you adapt / add keys to wpa_supp...

@Roman_Gruber ... no need to do that either ... you only need run 'wpa_cli reconfigure'.

best ... khay
Back to top
View user's profile Send private message
Fulgurance
Guru
Guru


Joined: 15 Feb 2017
Posts: 552

PostPosted: Tue Mar 28, 2017 10:36 pm    Post subject: Reply with quote

Okay, o finally choose to use dhcp and wpa_supplicant, but i have problem. wpa_cli start correctly and i add wifi point access with command line. No problem ! But when i would like to go on internet, no connexion ! Strange... Any idea ?
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Wed Mar 29, 2017 7:43 am    Post subject: Reply with quote

Fulgurance wrote:
Okay, o finally choose to use dhcp and wpa_supplicant, but i have problem. wpa_cli start correctly and i add wifi point access with command line. No problem ! But when i would like to go on internet, no connexion ! Strange... Any idea ?

Fulgurance ... not enough information to say, you can enabling debug logging on wpa_supplicant which should show what's failing, but I suspect it's an issue with how you are using wpa_cli (you're probably not running 'save_config' and so nothing gets written to wpa_supplicant.conf). So before enabling debug try editing /etc/wpa_supplicant/wpa_supplicant.conf directly, it should look something like the following:

/etc/wpa_supplicant/wpa_supplicant.conf:
ctrl_interface=DIR=/run/wpa_supplicant GROUP=wheel
update_config=1

network={
   ssid="your_ap"
   psk=your_psk
   proto=RSN
   key_mgmt=WPA-PSK
   auth_alg=OPEN
}

If you can't then associate with "your_ap" then do the following, restart the service, and pastebin the log.

/etc/conf.d/wpa_supplicant:
wpa_supplicant_args="-Dnl80211 -dd -f /var/log/wpa_supplicant.log"

edit: btw, I assume that the user using wpa_gui is in the 'wheel' group ... that may be what's happening, by default wpa_supplicant runs as root:root and so users can't access the cntl_interface, see the above wpa_supplicant.conf for how to change this to 'wheel'.

HTH & best ... khay
Back to top
View user's profile Send private message
Fulgurance
Guru
Guru


Joined: 15 Feb 2017
Posts: 552

PostPosted: Wed Mar 29, 2017 10:37 am    Post subject: Reply with quote

In fact, that's what I did, I used save_config, the proof, my wpa_supplicant.conf:
Code:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
update_config=1

network={
        ssid="Bbox-8C388EB8-5GHz"
        psk="PASSWORD"
}

I have just changed password for my security :)

And when i use debug mode:

Code:
wpa_supplicant -Dnl80211 -iwlan0 -C/var/run/wpa_supplicant/ -c/etc/wpa_supplicant/wpa_supplicant.conf -dd
wpa_supplicant v2.6
random: Trying to read entropy from /dev/random
Successfully initialized wpa_supplicant
Initializing interface 'wlan0' conf '/etc/wpa_supplicant/wpa_supplicant.conf' driver 'nl80211' ctrl_interface '/var/run/wpa_supplicant/' bridge 'N/A'
Configuration file '/etc/wpa_supplicant/wpa_supplicant.conf' -> '/etc/wpa_supplicant/wpa_supplicant.conf'
Reading configuration file '/etc/wpa_supplicant/wpa_supplicant.conf'
ctrl_interface='DIR=/var/run/wpa_supplicant GROUP=wheel'
update_config=1
Line: 4 - start of a new network block
ssid - hexdump_ascii(len=18):
     42 62 6f 78 2d 38 43 33 38 38 45 42 38 2d 35 47   Bbox-8C388EB8-5G
     48 7a                                             Hz             
PSK (ASCII passphrase) - hexdump_ascii(len=30): [REMOVED]
PSK (from passphrase) - hexdump(len=32): [REMOVED]
Priority group 0
   id=0 ssid='Bbox-8C388EB8-5GHz'
Could not read interface wlan0 flags: No such device
nl80211: Driver does not support authentication/association or connect commands
nl80211: deinit ifname=wlan0 disabled_11b_rates=0
nl80211: Remove monitor interface: refcount=0
netlink: Operstate: ifindex=0 linkmode=0 (kernel-control), operstate=6 (IF_OPER_UP)
Could not read interface wlan0 flags: No such device
nl80211: Set mode ifindex 0 iftype 2 (STATION)
nl80211: Failed to set interface 0 to mode 2: -19 (No such device)
wlan0: Failed to initialize driver interface
Failed to add interface wlan0
wlan0: Cancelling scan request
wlan0: Cancelling authentication timeout
Off-channel: Clear pending Action frame TX (pending_action_tx=(nil)


I'm testing this from a root account, and it does not work either.
Back to top
View user's profile Send private message
cboldt
l33t
l33t


Joined: 24 Aug 2005
Posts: 829

PostPosted: Wed Mar 29, 2017 10:59 am    Post subject: Reply with quote

What does `ifconfig -a` show?

From wpa_supplicant, there is no network device known as wlan0.
Back to top
View user's profile Send private message
Fulgurance
Guru
Guru


Joined: 15 Feb 2017
Posts: 552

PostPosted: Wed Mar 29, 2017 12:12 pm    Post subject: Reply with quote

Code:
fulgurance@MSI-GS73VR-6RF ~ $ sudo ifconfig -a
Mot de passe :
enp61s0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 4c:cc:6a:80:14:e2  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 17 

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1  (Boucle locale)
        RX packets 4656  bytes 361280 (352.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 4656  bytes 361280 (352.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

sit0: flags=128<NOARP>  mtu 1480
        sit  txqueuelen 1  (IPv6-dans-IPv4)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlp62s0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 9c:b6:d0:0e:57:d1  txqueuelen 1000  (Ethernet)
        RX packets 898  bytes 230319 (224.9 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 739  bytes 108846 (106.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Wed Mar 29, 2017 12:20 pm    Post subject: Reply with quote

you are using the new network names. I have no idea how they are named, how these names are created.

the old behaviour was eth0 for wired, wlan0 for wireless. wpa_supplicant manpage refers to the old naming

Quote:
wpa_supplicant -Dnl80211 -iwlan0 -C/var/run/wpa_supplicant/ -c/etc/wpa_supplicant/wpa_supplicant.conf -dd


-iwlan0 => -iwlp62s0

(if that does not work, try the other names from ifconfig -a)

No idea if that helps you: That is my content of my config file.

Code:
ASUS-G75VW roman # cat /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel

network={
       ssid="A1-6dc3e3"
       psk="removed evil password"
}


when you have that in your rc runlevel + eudev + openrc + the firmware for the wlan + the correct kernel settings (build in or modules for your current kernel), it should work itself with a reboot.

Code:
ASUS-G75VW roman # rc-update show|grep dhcpcd
               dhcpcd |      default                                 
ASUS-G75VW roman # rc-update show|grep wpa
       wpa_supplicant |      default   
Back to top
View user's profile Send private message
cboldt
l33t
l33t


Joined: 24 Aug 2005
Posts: 829

PostPosted: Wed Mar 29, 2017 12:36 pm    Post subject: Reply with quote

Well, something has to change. I sincerely don't know if it is easier in the long run to adjust boot/device setting to skip the "predicable device naming", or to adjust various network scripts to accommodate the "predictable device naming."

I do know that my choice was to keep the old device names, eth0, wlan0, etc. But I'm a Luddite by nature. Everything below, in this post, is on the subject of rejecting the "predictable device names."

I kept the old device names by making "net.ifnames=0" one of the kernel command boot parameters. I use lilo, so this adjustment was made, on my systems, in lilo.conf, after which I had to run `lilo` to make the change effective.

There are other ways to accomplish this preference. One of those ways is adjusting udev rules, creating a symlink ...

Code:
cd etc/udev/rules.d
rm 80-net-name-slot.rules
ln -s /dev/null 80-net-name-slot.rules


I believe the method for rejecting the "predictable device names" under systemd is different from that, but no systemd here.
Back to top
View user's profile Send private message
Fulgurance
Guru
Guru


Joined: 15 Feb 2017
Posts: 552

PostPosted: Wed Mar 29, 2017 1:28 pm    Post subject: Reply with quote

What is strange is that before I used NetworkManager, wpa_supplicant worked very well, I do not understand what could have changed ...
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Wed Mar 29, 2017 1:51 pm    Post subject: Reply with quote

Fulgurance wrote:
What is strange is that before I used NetworkManager, wpa_supplicant worked very well, I do not understand what could have changed ...

Fulgurance ... NetworkManager is providing the device name to wpa_supplicant, and it automagically figures out what that device name is. In the case of wpa_supplicant it requires you pass an ifname (or multiple ifnames).

best ... khay
Back to top
View user's profile Send private message
Fulgurance
Guru
Guru


Joined: 15 Feb 2017
Posts: 552

PostPosted: Wed Mar 29, 2017 4:23 pm    Post subject: Reply with quote

The folder doesn't exist:
Code:
fulgurance@MSI-GS73VR-6RF ~ $ cd etc/udev/rules.d
bash: cd: etc/udev/rules.d: Aucun fichier ou dossier de ce type


What should I do ?

I wonder if, for example, dhcpcd would be configured incorrectly, it might affect wpa_supplicant?
Back to top
View user's profile Send private message
cboldt
l33t
l33t


Joined: 24 Aug 2005
Posts: 829

PostPosted: Wed Mar 29, 2017 4:36 pm    Post subject: Reply with quote

My typo ... add a leading slash to the target of the cd command

Code:
cd /etc/udev/rules.d
Back to top
View user's profile Send private message
Fulgurance
Guru
Guru


Joined: 15 Feb 2017
Posts: 552

PostPosted: Wed Mar 29, 2017 10:07 pm    Post subject: Reply with quote

Oh sorry...

But i havent got file named 80-net-name-slot.rules, no files in this directory
Back to top
View user's profile Send private message
cboldt
l33t
l33t


Joined: 24 Aug 2005
Posts: 829

PostPosted: Wed Mar 29, 2017 10:17 pm    Post subject: Reply with quote

Edit to rearrange remarks: Since you have no such file, I suspect you are running systemd, in which case the udev rule "change" I suggested will have no effect. The kernel command parameter will have the desired effect no matter if you are using systemd, or not using systemd.

With that intro, you can ignore most of what is below ...

If you want to reject the persistent device naming (which is what I did) ...

make the file, soft-linked to /dev/null

Code:
ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules


Or else add the "net.ifnames=0" parameter to the kernel command line

If you are booting with systemd, then I don't know that softlinking /etc/udev/rules.d/80-net-name-slot.rules to /dev/null will have any effect at all.
Back to top
View user's profile Send private message
Fulgurance
Guru
Guru


Joined: 15 Feb 2017
Posts: 552

PostPosted: Wed Mar 29, 2017 10:34 pm    Post subject: Reply with quote

Im not on systemd, i use openrc.
Back to top
View user's profile Send private message
cboldt
l33t
l33t


Joined: 24 Aug 2005
Posts: 829

PostPosted: Wed Mar 29, 2017 10:55 pm    Post subject: Reply with quote

Since you do not use systemd, and do use openrc, then either the udev rule that rejects renaming network devices (this is the softlinking specified above), or telling the kernel to "net.ifnames=0" will work to reject the use of "persistent naming," and revert to network device names such as "eth0" and "wlan0"
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Thu Mar 30, 2017 10:07 am    Post subject: Reply with quote

as said "net.ifnames=0" is the easier path.

Quote:
Im not on systemd, i use openrc.


don*t you need usually openrc + eudev (or something else?) openrc is only half of the requirements.

Code:
ASUS-G75VW roman # cat /usr/portage/virtual/udev/udev-217.ebuild
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=5

DESCRIPTION="Virtual to select between different udev daemon providers"
HOMEPAGE=""
SRC_URI=""

LICENSE=""
SLOT="0"
KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86"
IUSE="systemd"

DEPEND=""
RDEPEND="
   !systemd? ( || ( >=sys-fs/eudev-2.1.1 >=sys-fs/udev-217 ) )
   systemd? ( >=sys-apps/systemd-217:0 )"


Just means:

systemd or => >=sys-fs/eudev-2.1.1 >=sys-fs/udev-217

I assume you have openrc + eudev, correct?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum