Setting up schroot for Python multiprocessing

When using Arch Linux, its sometimes required to run something in a older/stable releaes of a Linux distribution. For this purpose I have a Ubuntu 12.04 LTS installation in a schroot environment. However, using Bitbake (a heavily multithreded and Python based build utility) The build aborted with the error:

  File "/usr/lib/python2.7/multiprocessing/", line 63, in __init__
    self._rlock = Lock()
  File "/usr/lib/python2.7/multiprocessing/", line 147, in __init__
    SemLock.__init__(self, SEMAPHORE, 1, 1)
OSError: [Errno 13] Permission denied

It turns out that the permission for /dev/shm/ is not correctly setup. Setting them correctly by using chmod 1777 /dev/shm/ solved the problem only temporary since the /dev tree is rebuilt upon entering the chroot environment. A more permanent solution is altering the matching fstab file for the schroot environment in question (in my case /etc/schroot/default/fstab)

tmpfs           /dev/shm        tmpfs   rw,nosuid,nodev        0       0

Leave a Comment