You are not logged in.

#1 2015-10-20 16:19:19

Izzette
Member
Registered: 2015-10-02
Posts: 25

[SOLVED]: wpa_supplicant exits when the tty I started it on logs out.

It's the weirdest thing.

I run `wpa_supplicant -B nl80211 -i wlp1s0 -c /etc/wpa_supplicant/wpa_supplicant.conf`, exits 0.
It doesn't matter whether I'm running it off a pts or the login terminal, wpa_supplicant will run until I close that login terminal.
At this point, the internet works just fine on all ttys as well as processes not connected to a tty, wpa_supplicant is still running in the background.

Ps reports that the wpa_supplicant process it is not connected to a tty.
In /proc/<pid>/fd I find that the file descriptors 0, 1, and 2 are all links to /dev/null.
It seems that wpa_supplicant has no connection whatsoever to the tty I launched it from.

If I start wpa_supplicant using setsid or nohup, it makes no difference.

As soon as I close the tty I started wpa_supplicant on, it exits.
I find nothing helpful in dmesg.
Dhcpcd sticks around just fine. 

I'm not really sure if this is a new problem or an old problem, as I usually start wpa_supplicant from tty1 and never close it until I'm done using my computer anyways.

Last edited by Izzette (2015-11-06 17:17:16)

Offline

#2 2015-10-24 12:11:29

fdservices
Member
From: France
Registered: 2012-02-06
Posts: 413

Re: [SOLVED]: wpa_supplicant exits when the tty I started it on logs out.

I don't understand your problem.

At this point, the internet works just fine on all ttys as well as processes not connected to a tty, wpa_supplicant is still running in the background.

Ps reports that the wpa_supplicant process it is not connected to a tty

It does not need to be - you ran it as a daemon (-B)

As far as I can see everything is working fine. What exactly is the problem?

Andrew

Offline

#3 2015-11-06 01:43:16

Izzette
Member
Registered: 2015-10-02
Posts: 25

Re: [SOLVED]: wpa_supplicant exits when the tty I started it on logs out.

You know what, I couldn't reproduce this quite the way I described it.  But, my wpa_supplicant daemon keeps crashing, and it sure seems happening only when I close one of my login terminals.  I know, it doesn't make any sense, really.  But, I'm almost certain it's happening.

Offline

#4 2015-11-06 01:50:10

Izzette
Member
Registered: 2015-10-02
Posts: 25

Re: [SOLVED]: wpa_supplicant exits when the tty I started it on logs out.

I know what's happening.  When I start it with sudo from a non-root user login, pam closes my session when the terminal I started sudo on closes.  It doesn't happen when I log into root instead, because pam isn't involved.

See my journal

Nov 05 19:44:59 C720 dhcpcd[1748]: wlp1s0: Router Advertisement from fe80::cea4:62ff:fe1d:70c1
Nov 05 19:44:59 C720 login[16911]: pam_unix(login:session): session closed for user izzi
Nov 05 19:44:59 C720 systemd[1]: getty@tty3.service: Service has no hold-off time, scheduling restart.
Nov 05 19:44:59 C720 systemd[1]: Stopped Getty on tty3.
-- Subject: Unit getty@tty3.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit getty@tty3.service has finished shutting down.
Nov 05 19:44:59 C720 systemd[1]: Started Getty on tty3.
-- Subject: Unit getty@tty3.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit getty@tty3.service has finished starting up.
-- 
-- The start-up result is done.
Nov 05 19:44:59 C720 systemd[1]: Stopping Session c3 of user izzi.
-- Subject: Unit session-c3.scope has begun shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit session-c3.scope has begun shutting down.
Nov 05 19:44:59 C720 kernel: wlp1s0: deauthenticating from cc:a4:62:1d:70:c0 by local choice (Reason: 3=DEAUTH_LEAVING)
Nov 05 19:44:59 C720 dhcpcd[1748]: wlp1s0: carrier lost
Nov 05 19:44:59 C720 systemd[1]: Stopped Session c3 of user izzi.
-- Subject: Unit session-c3.scope has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit session-c3.scope has finished shutting down.
Nov 05 19:44:59 C720 systemd-logind[298]: Removed session c3.
-- Subject: Session c3 has been terminated
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat
-- 
-- A session with the ID c3 has been terminated.
Nov 05 19:44:59 C720 dhcpcd[1748]: wlp1s0: deleting address 2601:446:c200:3ae2:a5dd:8c0f:7a55:b10c/64
Nov 05 19:44:59 C720 dhcpcd[1748]: wlp1s0: deleting default route via fe80::cea4:62ff:fe1d:70c1
Nov 05 19:44:59 C720 dhcpcd[1748]: wlp1s0: deleting route to 2601:446:c200:3ae2::/64
Nov 05 19:44:59 C720 dhcpcd[1748]: wlp1s0: deleting default route via 10.0.0.1

But how can I get around this?

Last edited by Izzette (2015-11-06 01:54:14)

Offline

#5 2015-11-06 07:48:13

fdservices
Member
From: France
Registered: 2012-02-06
Posts: 413

Re: [SOLVED]: wpa_supplicant exits when the tty I started it on logs out.

Use the system to start wpa_supplicant, in my case I use systemd.

Andrew

Offline

#6 2015-11-06 09:53:15

fdservices
Member
From: France
Registered: 2012-02-06
Posts: 413

Re: [SOLVED]: wpa_supplicant exits when the tty I started it on logs out.

If you insist on running it manually have you tried "wpa_supplicant -B nl80211 -i wlp1s0 -c /etc/wpa_supplicant/wpa_supplicant.conf &"

Seems slightly counter-intuitive since you have asked it to run as a daemon, but the "&" will run it with PPID 1

Andrew

Offline

#7 2015-11-06 17:16:11

Izzette
Member
Registered: 2015-10-02
Posts: 25

Re: [SOLVED]: wpa_supplicant exits when the tty I started it on logs out.

I don't actually run it exactly that way, way to many characters to type.  I have a script in /usr/local/bin, which I keep in my path that does it.  I use systemd too, but when I've tried to enable wpa_supplicant@wlp1s0.service and it errors, and I don't know why.  Also, I use a couple different networking protocols depending on where I am, so enabling wpa_supplicant is kind of silly for me.  I'll mark this as solved, because it wasn't so much the problem I was having as why it was happening.  Now that I know why, I can come up with several solutions.  Also, I need to use setsid to get it's PPID to 1.  Thanks!

Offline

#8 2015-11-06 17:19:07

ayekat
Member
Registered: 2011-01-17
Posts: 1,616

Re: [SOLVED]: wpa_supplicant exits when the tty I started it on logs out.

Izzette wrote:

but when I've tried to enable wpa_supplicant@wlp1s0.service and it errors, and I don't know why.

Well, there is journalctl... but much more I suspect that the systemd service will try to read /etc/wpa_supplicant/wpa_supplicant-wlp1s0.conf.

Last edited by ayekat (2015-11-07 14:06:29)


pkgshackscfgblag

Offline

#9 2015-11-06 18:31:25

Izzette
Member
Registered: 2015-10-02
Posts: 25

Re: [SOLVED]: wpa_supplicant exits when the tty I started it on logs out.

Oh that makes sense, I'll make a symbolic link, see if that turns out.

Offline

Board footer

Powered by FluxBB