Ubuntu: How can I prevent iwconfig power management from being turned on? (9 solutions!)

Описание к видео Ubuntu: How can I prevent iwconfig power management from being turned on? (9 solutions!)

Ubuntu: How can I prevent iwconfig power management from being turned on?


The Question: I am affected by this bug: https://bugs.launchpad.net/ubuntu/+so...
+bug/869502.
A workaround which seems to stop the kernel panics for me is to disable wlan0
power management:
sudo iwconfig wlan0 power off
However it seems to automatically turn power management back on when I unplug
the power cable and I think at many other times, too.
Is there something that might be causing this? Does anyone know how I can
prevent it?

Solutions Sample (Please watch the whole video to see all solutions, in order of how many people found them helpful):

== This solution helped 25 people ==
Wireless powermanagement is run by a hook in pm-utils. You can turn it off in
any of the following way:
Create a file in /etc/pm/config.d. I have named it blacklist:
gksu gedit /etc/pm/config.d/blacklist
and inside the file keep:
HOOK_BLACKLIST="wireless"
If you want to disable any other hooks, default hooks are located at /usr/lib/
pm-utils/power.d/.
OR
You can just create an empty hook in either /etc/pm/sleep.d or /etc/pm/power.d.
See which one works for you. i.e.
Just do
sudo touch /etc/pm/sleep.d/wireless
OR
sudo touch /etc/pm/power.d/wireless

== This solution helped 22 people ==
If turning off power management for your wireless interface speeds up internet
like this:
sudo iwconfig wlan0 power off
Than to make it permanent run command as follows:
1. cd /etc/pm/power.d
2. sudo gedit wifi_pwr_off
This will open an empty file, copy the code below into it:
#!/bin/sh
/sbin/iwconfig wlan0 power off
3. Save the file, remember to
sudo chmod +x wifi_pwr_off
and restart.

== This solution helped 1 person ==
Great advice. 'sudo iwconfig wlan0 power off' seems the only way to get my
ath9k module stabily working (with kernel 3.2 - curiously in kernel > 3.5 there
seems to be no problem, but that kernels because of their suspend-to-ram/disk
problems with amd64 seem to be a no go, unfortunately . . . :-( )

== This solution helped 4 people ==
My preferred way is to add the following line in /etc/network/interfaces to my
wireless interface's settings:
post-up iwconfig wlan0 power off
Here's a complete example:
auto wlan0
iface wlan0 inet static
address 192.168.1.2
network 192.168.1.0
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.254
post-up iwconfig wlan0 power off
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
Note that man interfaces says the behaviour of post-up may change in the
future.

== This solution helped 3 people ==
For some reason, the top-voted solutions didn't work for me and power
management kept turning back on. I ended up doing the following:
sudo gedit /etc/rc.local
And added the following line before exit 0:
( sleep 30 && iwconfig wlan0 power off )&
That turns off power management 30 seconds after logging in...
Edit: Actually that wasn't enough. I kept trying a bunch of stuff, including
https://askubuntu.com/a/614245 which I think solved my problem (I hope).

== This solution helped 3 people ==
Another approach is to add an explicit directive (wireless-power) to control
power management in the /etc/network/interfaces configuration file (e.g.
Disable it for wlan0 with DHCP):
auto wlan0
iface wlan0 inet dhcp
wireless-power off

With thanks & praise to God! With thanks to the many people who have made this project possible! | Content (except music & images) licensed under cc by-sa 3.0 | Music: https://www.bensound.com/royalty-free... | Images: https://stocksnap.io/license & others | With thanks to user user3273814 (https://askubuntu.com/users/530948), user sagarchalise (https://askubuntu.com/users/1543), user RobM (https://askubuntu.com/users/12715), user Pierz (https://askubuntu.com/users/233795), user J.-S. Farinet (https://askubuntu.com/users/101603), user Eric Carvalho (https://askubuntu.com/users/65926), user d a i s y (https://askubuntu.com/users/378524), user chriscz (https://askubuntu.com/users/376544), user Carmine Paolino (https://askubuntu.com/users/349291), user Atul Kakrana (https://askubuntu.com/users/34201), user Anis Abboud (https://askubuntu.com/users/263454), user Alex (https://askubuntu.com/users/26445), and the Stack Exchange Network (http://askubuntu.com/questions/85214). Trademarks are property of their respective owners. Disclaimer: All information is provided "AS IS" without warranty of any kind. You are responsible for your own actions. Please contact me if anything looks amiss at Roel D.OT VandePaar A.T gmail.com.

Комментарии

Информация по комментариям в разработке