You are not logged in.

#1 2013-06-29 02:46:40

timrichardson
Member
Registered: 2013-02-12
Posts: 10

changing the delay for wifi to restart are resume in the systemd world

Long time ago I knew the pm-utils used to run what happened on resume from suspend. There was often a script to delay the attempt to reconnect wifi, to allow the card to settle. I never needed that delay so I would get rid of it.

Now I'm using archlinux and it doesn't use pm-utils. The wiki says that systemd does everything. The wiki article points to configuration files for systemd which I don't seem to have. Where is the resume functionality, and where do I look to change the wifi reconnection behaviour?
I'm using xfce and wicd

thanks
Tim

Offline

#2 2013-06-29 02:56:45

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: changing the delay for wifi to restart are resume in the systemd world

What are these configuration files that you don't have?  You need to be more specific.  Also, you say that you never needed this functionality for pm-utils, so I am curious as to what you are trying to accomplish here.  I presume that you are saying that you are under the impression that systemd is actually doing what pm-utils did before.  If so, this is not the case.  Pm-utils acted as workaround scripts for what were kernel bugs.  But these things have been pretty much all fixed. 

Systemd doesn't really do anything except write "mem" to /sys/power/state.  There are some services that pull in certain functions when going into or waking from sleep, but this is done by hooking services into the sleep.target or suspend.target.  Though there is a directory /usr/lib/systemd/system-sleep that has similar functionality to the pm-utils scripts.  Anything you drop in there will be run when the system suspends or hibernates.  A couple arguments are also given to the script, so that you can fine tune it dpending on what it is doing.  But unlike pm-utils, these scripts are all run in parallel.

Offline

#3 2013-06-29 03:28:08

timrichardson
Member
Registered: 2013-02-12
Posts: 10

Re: changing the delay for wifi to restart are resume in the systemd world

Fast answer; thanks.
Here is my "context". I remember in the past that pm-utils had scripts that controlled everything that happened on resume/suspend, such as terminating and unloading certain modules.
It also used to control the wifi interface coming back up. By default, it used to wait 5 seconds from memory before bringing the interface up.
On laptops I used, I could remove this 5 second delay with no adverse effects, so I would.

Now I am lost trying to work out how the wifi interface is brought back up. Is it 100% in the kernel and beyond user control?
The arch wiki says that systemd looks after suspend/resume. I don't have pm-utils installed, and the wiki entry https://wiki.archlinux.org/index.php/Sy … management advises that pm-utils scripts wouldn't be run anyway (see heading sleep hooks)
That same article refers me to "Suspend/resume service files" but I don't have any sleep or resume scripts in the location /etc/systemd/system/

It goes on to say "systemd runs all executables in /usr/lib/systemd/system-sleep/" but I have one script here, to do with upower.

So I'm at sea: how can I change resume behaviour to get faster wifi interface up on resume?

Offline

#4 2013-06-29 04:21:12

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: changing the delay for wifi to restart are resume in the systemd world

Here is my "context". I remember in the past that pm-utils...

Again, you shouldn't need to do anything, as there is nothing to work around now.  If you notice that your interface isn't reappearing, then maybe you have a buggy module that might need some kind of manual intervetion, like using the system-sleep directory.

Now I am lost trying to work out how the wifi interface is brought back up.

This is not very specific.  Are you talking about the interface itself (ie. wlan0) or that your network is not reconnecting on its own?  In either case, you should probably indicate either what hardware you are using and how you are setting up your wirless in the first place.

In that systemd section you mention, it says that service files can be hooked in, and that "separate files should be created for user actions and root/system actions". 

So I'm at sea: how can I change resume behaviour to get faster wifi interface up on resume?

Here again, I have no idea what you are using to create the connection in the first place.  Though you have to understand that the wireless card has to reassociate with the access point and then reestablish its previous IP (if it is still available).  If it is not, then it would need to get a new lease.  The question is how long does it take for you it to reconnect?  Is it some ridiculous amount of time, then there is something to fix, but you haven't specifed if it is abnormal or if you are just trying to rice every little aspect of your system.

Offline

#5 2013-06-29 08:45:01

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

Re: changing the delay for wifi to restart are resume in the systemd world

How slowly does it come back up right now?

Offline

#6 2013-06-29 22:01:25

timrichardson
Member
Registered: 2013-02-12
Posts: 10

Re: changing the delay for wifi to restart are resume in the systemd world

Hi tomk,
it takes about five seconds. I use wicd and xfce.
I've used this laptop for years and the card is capable of association much more quickly. It has an led indicator and the delay is not the time to reassociate with the network, it is a delay before the card is sent up ("turned on").  Somewhere there is a delay. I'm not surprised by this because when pm-utils was running the show, there was a five second artificial delay.
My real question is: now, in the new world of systemd, which scripts takes the card up? How does it work? Something is asking wicd to up the interface, but what? Is it a notification sent by dbus by systemd? Is there another forum I should be asking on?

Offline

#7 2013-06-29 22:09:17

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

Re: changing the delay for wifi to restart are resume in the systemd world

Mine is up when the rest of the system comes up. That's not very helpful, I know, but it suggests that there is no "artificial delay", as you put it, by default.

Have you ruled out the possibility that it's wicd?

Offline

#8 2013-06-29 22:22:47

timrichardson
Member
Registered: 2013-02-12
Posts: 10

Re: changing the delay for wifi to restart are resume in the systemd world

no, haven't ruled that out. I'll look into wicd.

Offline

#9 2013-06-29 22:52:55

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: changing the delay for wifi to restart are resume in the systemd world

Wicd takes much longer than other netowkr management services in my experience.

Offline

#10 2013-06-29 23:34:41

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

Re: changing the delay for wifi to restart are resume in the systemd world

I use plain wpa_supplicant (I make the assumption that there is no intermediate abstraction level that could slow things down, correct me if I'm wrong), and yet associating+DHCP alone takes about 5 to 10 seconds (depending on whether I have changed the location while being suspended, if the IP is still available, what WiFi I connect to, etc.), so I don't expect it to connect any faster after resuming from a suspend.

But then again, my machine is admittedly not the fastest, so what seems normal to me might drive other people nuts.

Anyway, I consider 5 seconds rather fast.

Last edited by ayekat (2013-06-29 23:35:20)


pkgs │ hacks │ cfg │ blag

Offline

#11 2013-06-30 20:27:04

timrichardson
Member
Registered: 2013-02-12
Posts: 10

Re: changing the delay for wifi to restart are resume in the systemd world

Probably I'm most annoyed by not understanding how it works.

Offline

Board footer

Powered by FluxBB