** Tags added: noble
** Description changed:
Ubuntu installs its Wi-Fi power save default into the admin's directory:
/etc/NetworkManager/conf.d/default-wifi-powersave-on.conf
[connection]
wifi.powersave = 3
NetworkManager reads conf.d in byte order and the last file to set a key
wins, so any admin snippet whose name sorts before "default-" has no
effect. For example:
/etc/NetworkManager/conf.d/99-wifi-powersave-off.conf
[connection]
wifi.powersave = 2
is silently ignored, because "9" sorts before "d".
+
+ Expected: the admin's 99- file decides, since files in /etc should
+ override package defaults.
I ran into this on a ThinkPad T490 with 24.04 (network-manager
1.46.0-1ubuntu2.8): power save was back on after a reboot although the
99- file was in place. It is still the case today; the active
connection's own setting is "default", and
$ iw dev wlp0s20f3 get power_save
Power save: on
The other snippets Ubuntu ships (10-*.conf) already go to
/usr/lib/NetworkManager/conf.d/. NetworkManager.conf(5) describes that
directory as the place for package defaults: it is parsed first, any
file in /etc overrides it, and a file of the same name in /etc shadows
it. Debian doesn't ship this file, so this looks Ubuntu-specific. The
packaging is the same in noble (1.46.0-1ubuntu2.8) and in the devel
series (1.58.1-1ubuntu3). The file was added for the power save change
in bug 1557026.
- Proposed fix (I will attach a debdiff once this bug has a number):
- install the file to /usr/lib/NetworkManager/conf.d/ instead, with the
- default (3) unchanged. On upgrade:
+ Proposed fix (debdiff to follow): install the file to
+ /usr/lib/NetworkManager/conf.d/ instead, with the default (3) unchanged.
+ On upgrade:
- an unmodified copy in /etc is removed;
- an edited copy in /etc is kept, so the admin's setting still applies;
- if the admin had deleted it, an empty file of the same name is put in
/etc, so the new default stays shadowed and power save stays as they had it.
I didn't use "dpkg-maintscript-helper rm_conffile" because it moves an
edited copy to .dpkg-bak, which NetworkManager doesn't read. Many guides
tell people to edit or delete this file, and they would get power save
turned back on by the upgrade.
Tested by upgrading from 1.58.1-1ubuntu3 to the patched package (built
for arm64, upgrade run in a container) with 99-wifi-powersave-off.conf
in place, and reading "NetworkManager --print-config":
- /etc copy before upgrade before after /etc copy after
- unmodified 3 2 removed
- edited to 2 2 2 kept
- deleted by admin 2 2 empty file
- fresh install 3 2 -
+ unmodified /etc copy: 3 before, 2 after; the copy is removed
+ /etc copy edited to 2: 2 before, 2 after; the copy is kept
+ /etc copy deleted by admin: 2 before, 2 after; an empty file is left
+ fresh install: 3 before, 2 after
Without the 99- file the default stays 3, except in the "deleted" case,
where it stays unset as it was before the upgrade.
The same placement is in noble; I can prepare an SRU once the devel
change is accepted, if that's wanted.
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2174507
Title:
default-wifi-powersave-on.conf in /etc overrides admin snippets in
conf.d that sort before it
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/2174507/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs