2

I want to run a script on a Planetlab node in Planetlab nodes, many users share the same computer and each user is allocated a slice I have a root, but I think it is a limted root priviledge for this script

#!/usr/bin/env python

import multiprocessing
import time

def func(msg):
    print msg
    time.sleep(20)
    print 'finish '+str(msg)

if __name__ == "__main__":
    pool = multiprocessing.Pool(processes=100)
    for i in xrange(20):
        msg = "hello %d" %(i)
        pool.apply_async(func, (msg, ))
        time.sleep(5)
    pool.close()
    pool.join()
    print "Sub-process(es) done."

I got the following error

Traceback (most recent call last):
  File "try.py", line 12, in <module>
    pool = multiprocessing.Pool(processes=100)
  File "/usr/lib/python2.6/multiprocessing/__init__.py", line 227, in Pool 
    return Pool(processes, initializer, initargs) 
  File "/usr/lib/python2.6/multiprocessing/pool.py", line 84, in __init__
    self._setup_queues()
  File "/usr/lib/python2.6/multiprocessing/pool.py", line 131, in _setup_queues
    self._inqueue = SimpleQueue()
  File "/usr/lib/python2.6/multiprocessing/queues.py", line 315, in __init__
    self._rlock = Lock()
  File "/usr/lib/python2.6/multiprocessing/synchronize.py", line 117, in __init__
    SemLock.__init__(self, SEMAPHORE, 1, 1)
  File "/usr/lib/python2.6/multiprocessing/synchronize.py", line 49, in __init__
    sl = self._semlock = _multiprocessing.SemLock(kind, value, maxvalue)
OSError: [Errno 38] Function not implemented

from google, someone suggested the solution is:

Add to /etc/fstab mounting of /dev/shm command
1   tmpfs /dev/shm    tmpfs   defaults,noexec,nosuid     0     0

Mount all unmounted filesystems from /etc/fstab.
1   $ mount -a

but I got error: mount: permission denied

I also tried:

mount /dev/shm

still the same error is it possible to solve this kind of problems in a planetlab node slice? thanks!

karthikr
  • 97,368
  • 26
  • 197
  • 188
misteryes
  • 2,167
  • 4
  • 32
  • 58
  • Another [solution](http://stackoverflow.com/a/10808102/2373278) to similar problem recommended `reboot` the system. Since you are having your own slice, you should be able to reboot, i guess. – ViFI Feb 06 '17 at 12:28

0 Answers0