Disabling wireless power management in Ubuntu
I recently installed 10.10 on my MacBook Pro and noticed that whenever I went into battery mode, my wireless connectivity was severely crippled. A look at iwconfig confirmed that the wifi power management was being enabled every time I yanked the plug. I scoured /etc and couldn’t find any acpi or pm event that would trigger this.
After digging through the filesystem, I found that Ubuntu has a default set of power events set in /usr/lib/pm-utils/power.d. Therein I found a “wireless” script which enabled power management mode whenever a battery power event was triggered.
The script didn’t appear to have any way to configure an override for this behaviour, and I *abhor* doing any form of config management in /usr. Luckily, I found a somewhat non-intuitive solution. Any script in the /usr/lib/pm-utils/ directory can be overridden simply by creating a script of the same name in /etc/pm. I created a blank file called “/etc/pm/power.d/wireless” and voila, no more wireless power management.
A few users have mentioned that placing the blank file in their power.d directory did not work for them. I should note that creating this file simply stops the power-management system from executing the contents of /usr/lib/pm-utils/power.d/wireless, it does nothing to actually switch your interface back. It appears that in some actions, such as closing the laptop and opening it back up, can trigger the hardware itself to go into power management mode. You can forcefully prevent that by placing the following in the “/etc/pm/power.d/wireless” file.
#!/bin/sh /sbin/iwconfig eth1 power off