Semaphores cannot be created in lxc container
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Invalid
|
High
|
Unassigned | ||
lxc (Ubuntu) |
Fix Released
|
High
|
Stéphane Graber | ||
Precise |
Fix Released
|
High
|
Stéphane Graber | ||
Quantal |
Fix Released
|
High
|
Stéphane Graber | ||
sysvinit (Debian) |
Fix Released
|
Unknown
|
|||
sysvinit (Ubuntu) |
Fix Released
|
High
|
Stéphane Graber | ||
Precise |
Fix Released
|
High
|
Stéphane Graber | ||
Quantal |
Fix Released
|
High
|
Stéphane Graber |
Bug Description
[rational]
Current initscripts doesn't deal properly with chroots, bind-mounting /run/shm to /dev/shm instead of making the later a symlink to the former.
LXC has been carrying a workaround for that, sadly the workaround stopped working late in the 12.04 cycle, meaning that an extra chunk of code had to be added to properly fix any broken container before applying the upgrade as any initscripts update would otherwise fail.
[test case]
Two things to test:
1) lxc-create -t ubuntu -n p1
2) Check that /dev/shm is a symlink to /run/shm in the container
1) Get an existing container
2) Update to -proposed
3) Check that /dev/shm is now a symlink to /run/shm
[regression potential]
There's a known risk for applications using shm during the upgrade as the entries will be moved to another file system. As long as all the processes accessing the file keep running, it should be fine, but it won't if another one is spawned as it will try reading it from the new location. A warning is displayed recommending a reboot.
The rest of the code was already tested with all known scenario and should be sufficiently guarded to only apply to the affected systems.
>>> from multiprocessing import synchronize
>>> synchronize.Lock()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/
SemLock.
File "/usr/lib/
sl = self._semlock = _multiprocessin
OSError: [Errno 38] Function not implemented
Thanks to hallyn, there's a workaround and a fix: adding this line to the container's fstab will fix the problem:
none dev/shm tmpfs defaults 0 0
He is updating the ubuntu template with this change.
Original bug report description was Launchpad related (celery tests fail on parallel testing instances)
Changed in lxc (Ubuntu): | |
importance: | Undecided → High |
assignee: | nobody → Serge Hallyn (serge-hallyn) |
milestone: | none → ubuntu-12.04 |
status: | New → Confirmed |
Changed in sysvinit (Ubuntu): | |
importance: | Undecided → High |
tags: | added: patch |
Changed in sysvinit (Debian): | |
status: | Unknown → New |
Changed in lxc (Ubuntu Quantal): | |
milestone: | ubuntu-12.04 → quantal-alpha-2 |
tags: | added: rls-q-incoming |
Changed in sysvinit (Debian): | |
status: | New → Fix Released |
Changed in sysvinit (Ubuntu Precise): | |
assignee: | nobody → Canonical Foundations Team (canonical-foundations) |
Changed in sysvinit (Ubuntu Quantal): | |
assignee: | nobody → Canonical Foundations Team (canonical-foundations) |
Changed in sysvinit (Ubuntu Quantal): | |
assignee: | Canonical Foundations Team (canonical-foundations) → Stéphane Graber (stgraber) |
Changed in sysvinit (Ubuntu Precise): | |
assignee: | Canonical Foundations Team (canonical-foundations) → Stéphane Graber (stgraber) |
description: | updated |
Changed in sysvinit (Ubuntu Precise): | |
status: | Triaged → In Progress |
Changed in lxc (Ubuntu Precise): | |
importance: | Undecided → High |
status: | Fix Released → Triaged |
assignee: | nobody → Stéphane Graber (stgraber) |
Changed in lxc (Ubuntu Quantal): | |
assignee: | Serge Hallyn (serge-hallyn) → Stéphane Graber (stgraber) |
status: | Fix Released → Triaged |
milestone: | quantal-alpha-2 → none |
Changed in lxc (Ubuntu Precise): | |
milestone: | none → ubuntu-12.04.1 |
description: | updated |
This is easily and repeatably duplicatable on in my lxc lucid container. The error for the last test (with the multiprocessing SemLock OSError seems the most likely to be a shared root cause to me. Interestingly, the OSError was slightly different for me, with a newer lxc: "OSError: [Errno 38] Function not implemented". I checked the syslog and some random other log files, without really knowing where to look, and saw nothing of interest.
As you'd expect from the traceback, you can repeat this error with a single Python call to the standard library.
>>> from multiprocessing import synchronize python2. 6/multiprocessi ng/synchronize. py", line 117, in __init__ __init_ _(self, SEMAPHORE, 1, 1) python2. 6/multiprocessi ng/synchronize. py", line 49, in __init__ g.SemLock( kind, value, maxvalue)
>>> synchronize.Lock()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/
SemLock.
File "/usr/lib/
sl = self._semlock = _multiprocessin
OSError: [Errno 38] Function not implemented
38 is ENOSYS
I talked with hallyn and this is an lxc issue. Adding this line to the container's fstab will fix the problem:
none dev/shm tmpfs defaults 0 0
He is updating the ubuntu template with this change.