Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
no network after suspend/resume
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 782
Location: usually offline

PostPosted: Wed Jun 28, 2017 12:29 pm    Post subject: no network after suspend/resume Reply with quote

netifrc works fine at boot. i have network and all is well.

after a suspend/resume, i have no network. i am reconnected to the wifi network. dmesg shows wlan0 associated. "/usr/sbin/iw wlan0" link shows connected too. i have the same ip from before suspend, but i think udhcpc didn't trigger after wifi reconnected.

i can manually "busybox udhcpc -i wlan0", and all is well again. what am i missing?
Back to top
View user's profile Send private message
chiefbag
Guru
Guru


Joined: 01 Oct 2010
Posts: 542
Location: The Kingdom

PostPosted: Wed Jun 28, 2017 2:03 pm    Post subject: Reply with quote

Would "sys-apps/netplug" be useful here?
Back to top
View user's profile Send private message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 782
Location: usually offline

PostPosted: Wed Jun 28, 2017 2:20 pm    Post subject: Reply with quote

chiefbag wrote:
Would "sys-apps/netplug" be useful here?

thank yes :) it does trigger wpa_cli and reconnects wifi. but i think it doesn't trigger udhcpc. i can run udhcpc to get an ip, and all is well afters. do you use wifi with netplug?
Back to top
View user's profile Send private message
chiefbag
Guru
Guru


Joined: 01 Oct 2010
Posts: 542
Location: The Kingdom

PostPosted: Wed Jun 28, 2017 2:26 pm    Post subject: Reply with quote

No I have never tried it with WiFi but use it for wired, just did a quick Google and it appears it supports wired and WiFi.
Back to top
View user's profile Send private message
chiefbag
Guru
Guru


Joined: 01 Oct 2010
Posts: 542
Location: The Kingdom

PostPosted: Wed Jun 28, 2017 2:33 pm    Post subject: Reply with quote

Perhaps it only supports dhcpcd and not udhcpc triggering.

You could always modify the /etc/netplug.d/netplug script

http://www.red-bean.com/~bos/netplug/netplugd.8.html
Back to top
View user's profile Send private message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 782
Location: usually offline

PostPosted: Wed Jun 28, 2017 4:28 pm    Post subject: Reply with quote

chiefbag wrote:
No I have never tried it with WiFi but use it for wired, just did a quick Google and it appears it supports wired and WiFi.

i ran netplugd in the foreground and could see it picking up the events as i turned my wifi device on and off. wpa_cli was being triggered from somewhere.. and wifi network was reconnecting. but it seemed to stop there, rather than go further and dhcp. i'm going to look a bit deeper into the code, if i can get my head around where this is happening.

chiefbag wrote:
Perhaps it only supports dhcpcd and not udhcpc triggering.

You could always modify the /etc/netplug.d/netplug script

perhaps.. atmo i'm more keen on udhcpc than dhcpcd. if i go that way, i might as get rid of the whole netifrc stack.

that netplug script is triggering /etc/init.d/net.${IFACE}. when i run it manually, i get dhcp ip correctly. but it doesn't seem to happen automagically. bit stumped.


Last edited by josephg on Wed Jun 28, 2017 5:21 pm; edited 1 time in total
Back to top
View user's profile Send private message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 782
Location: usually offline

PostPosted: Wed Jun 28, 2017 5:20 pm    Post subject: Reply with quote

i removed netplug by "emerge -c netplug". so my interface shouldn't hotplug, right? wrong! it still does so.. syslog shows wpa_cli as DISCONNECTED and CONNECTED after suspend and resume.
/var/log/messages:
Jun 28 18:15:18 localhost user.notice wpa_cli: interface wlan0 DISCONNECTED
Jun 28 18:15:18 localhost user.notice wpa_cli: executing 'false /etc/init.d/net.wlan0 --quiet stop' failed
Jun 28 18:15:19 localhost user.notice wpa_cli: interface wlan0 CONNECTED
Jun 28 18:15:19 localhost user.notice wpa_cli: executing '/etc/init.d/net.wlan0 --quiet start' failed

i wonder what's calling wpa_cli during suspend/resume.. would it be s2ram?
Back to top
View user's profile Send private message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 782
Location: usually offline

PostPosted: Thu Jun 29, 2017 8:25 am    Post subject: Reply with quote

i wanted to remain with the gentoo netifrc stack, as i had a lot configured just the way i like it. everyone on #gentoo kept telling me to use dhcpcd instead. getting involved in the openrc-init vs sysvinit debate opened me up to thinking again. perhaps i shouldn't use the same package for init and networking. reluctantly, i have removed and replaced the entire netifrc stack with dhcpcd. suspend/resume automatically brings up the network and i haven't specified so anywhere. dhcpcd runs all the time and does everything automatically, whether i want it or not. for example, i don't want my laptop to be automatically connected to the network, if a cable is inserted. since i don't know how to stop that happening, i have to blacklist my ethernet module.
Back to top
View user's profile Send private message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 782
Location: usually offline

PostPosted: Fri Jun 30, 2017 7:59 am    Post subject: Reply with quote

i figured out how to dhcpcd listen only for specific interfaces
/etc/dhcpcd.conf:
allowinterfaces wlan0
Back to top
View user's profile Send private message
szatox
Veteran
Veteran


Joined: 27 Aug 2013
Posts: 1717

PostPosted: Fri Jun 30, 2017 7:29 pm    Post subject: Reply with quote

I had a similar issue with a wifi in master mode. What I did was creating a simple script.
sys-power/pm-utils invokes this script every time my pc wakes up after suspend. I'm pretty sure you could tune it to your needs if you feel like you needed it.

Code:
 # cat /etc/pm/sleep.d/hostapd
#! /bin/bash
if /etc/init.d/hostapd status
then /etc/init.d/hostapd restart
fi
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security 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