value set in /etc/sysctl.conf not used at boot time

Bug #803739 reported by Yves Dorfsman
20
This bug affects 2 people
Affects Status Importance Assigned to Milestone
procps (Ubuntu)
Fix Released
High
Unassigned

Bug Description

This is at the bottom of my /etc/sysctl.conf

net.ipv6.conf.all.use_tempaddr = 2
net.ipv6.conf.wlan0.use_tempaddr = 2
net.ipv6.conf.eth0.use_tempaddr = 2
net.ipv6.conf.eth1.use_tempaddr = 2

Yet, after a reboot:
$ sysctl net.ipv6.conf.wlan0.use_tempaddr
net.ipv6.conf.wlan0.use_tempaddr = 0
$ sysctl net.ipv6.conf.eth0.use_tempaddr
net.ipv6.conf.eth0.use_tempaddr = 2

then as root:
# sysctl net.ipv6.conf.wlan0.use_tempaddr=2
net.ipv6.conf.wlan0.use_tempaddr = 2

This is on Ubuntu 11.04 64 bit. This behaviour does not happen on Ubuntu 10.10 32 bit.

$ lsb_release -rd
Description: Ubuntu 11.04
Release: 11.04

$ apt-cache policy procps
procps:
  Installed: 1:3.2.8-10ubuntu3
  Candidate: 1:3.2.8-10ubuntu3
  Version table:
 *** 1:3.2.8-10ubuntu3 0
        500 http://ca.archive.ubuntu.com/ubuntu/ natty/main amd64 Packages
        100 /var/lib/dpkg/status

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: procps 1:3.2.8-10ubuntu3
ProcVersionSignature: Ubuntu 2.6.38-8.42-generic 2.6.38.2
Uname: Linux 2.6.38-8-generic x86_64
Architecture: amd64
Date: Wed Jun 29 23:41:24 2011
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release amd64 (20110427.1)
ProcEnviron:
 LANGUAGE=en_CA:en
 PATH=(custom, no user)
 LANG=en_CA.UTF-8
 SHELL=/bin/bash
SourcePackage: procps
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Yves Dorfsman (dorfsmay) wrote :
Revision history for this message
Dave Gilbert (ubuntu-treblig) wrote :

Hi Yves,
  A few things to try:
     1) If you do start procps do the values get set? (Are there any errors?)
     2) what about writing directly to the entry - i.e. (from a root shell - not a sudo at the start of the line!)
         echo 2 > /proc/sys/net/ipv6/conf/all/use_tempaddr

Changed in procps (Ubuntu):
status: New → Incomplete
Revision history for this message
Yves Dorfsman (dorfsmay) wrote :

> 2) what about writing directly to the entry

Yes, that works, even just doing
 sysctl net.ipv6.conf.wlan0.use_tempaddr=2

works.

> 1) If you do start procps do the values get set?

Huh... it does. This is confusing. Right after boot, three of the four values are set (all, eth0 and eth1). Wlan0 is not set. I just ran (as root):
 start procps
And got:
 procps stop/waiting

Which is the same thing I get when I do "status procps". But this time, it did set that one extra value.

Revision history for this message
Dave Gilbert (ubuntu-treblig) wrote :

Hi Yves,
  OK that means most stuff is working as it should; I think stop/waiting for procps is normal - it just does its setup stuff and stops again.

  Two thoughts then; I wonder whether at the time procps runs during startup wlan0 has been found yet? If it's not then I guess /proc/sys/net/ipv6/conf/wlan0 might not be there yet.The other thought is maybe something is setting it back after procps has run - but I think that's less likely.

Dave

Changed in procps (Ubuntu):
status: Incomplete → New
Revision history for this message
Yves Dorfsman (dorfsmay) wrote :

Yes I thought about wlan0 not being available, and I purposely rebooted the laptop making sure that the network kill switch was on etc... wlan0 came up right away, but net.ipv6.conf.wlan0.use_tempaddr was equal zero (the other ones were equal to one). I also check the spelling and copied and paste from a sysctl command line.

I know this works as advertised on my other laptops, but, the older ones are T60s and running Ubuntu 10.10 32 bit, the one with the problem is a new x220 running Ubuntu 11.04 64 bit.

There is one of the T60 that could run 64 bit, I'll try to upgrade it as soon as I get a minute for comparison purpose.

Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

I can somewhat reproduce this on my system, except the device that comes up early is (more expectedly than wlan0) eth0. All interfaces but that one do get the right value set for use_tempaddr; and there seems to be something fishy going on when setting these values in sysctl anyway: net.ipv6.conf.all.use_tempaddr doesn't affect all the interfaces directly as it seems it should, nor does it override the behaviour at all.

I sent an email to linux-netdev regarding this matter: http://marc.info/?l=linux-netdev&m=132285083905998&w=4

As a workaround I guess we might want to set some of these things in initramfs (althought there are some cases where we want to not have an initramfs, then we're still stuck), or somehow in udev; until this is clarified and fixed in the kernel.

Changed in procps (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Changed in procps (Ubuntu):
importance: Medium → High
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

I think what you're really running into is that wlan0 comes up after the sysctls are applied. Using net.ipv6.conf.all.use_tempaddr should fix this in Precise now for devices that existed prior to the sysctls being applied, and net.ipv6.conf.default.use_tempaddr was already meant to take care of the case of devices coming up after the sysctls are applied (and things have been that was as far as I can remember).

As such, I'll close this as Fix Released because there is an easy workaround for your case with clearly known devices on a system (meaning, there was no bug, the sysctls can't be applied if the device doesn't exist and we're running the sysctls are early and as late as feasible); and where using the per-device sysctls and .default. would work, and because we've started shipping Precise with .all and .default set to =2 along with a kernel patch to allow .all to work properly.

Changed in procps (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Of course, don't hesitate to set this bug back to New if you feel I've missed or forgotten something :)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

Bug watches keep track of this bug in other bug trackers.