Python multiprocessing: Permission denied


T

t0ster

Hi guys, I'm getting an error when trying to execute python program
that uses multiprocessing package:

File "/usr/local/lib/python2.6/multiprocessing/__init__.py", line
178, in RLock
return RLock()
File "/usr/local/lib/python2.6/multiprocessing/synchronize.py", line
142, in __init__
SemLock.__init__(self, RECURSIVE_MUTEX, 1, 1)
File "/usr/local/lib/python2.6/multiprocessing/synchronize.py", line
49, in __init__
sl = self._semlock = _multiprocessing.SemLock(kind, value,
maxvalue)
OSError: [Errno 13] Permission denied

It looks like the user don't have permission to access shared memory.
When executing with root privileges it works fine.

Is there any solution to run it as normal user(not root)?

Python version 2.6.2 , OS is Linux 2.6.18 (CentOS release 5.4) and
it's VPS machine.
 
Ad

Advertisements

S

Steven D'Aprano

It looks like the user don't have permission to access shared memory.
When executing with root privileges it works fine.

Is there any solution to run it as normal user(not root)?

Then give the user permission to access shared memory.

Why do you expect that Python would be able to over-ride the operating
system's security? This problem is no different from saying "It looks
like the user doesn't have permission to access this file".
 
Ad

Advertisements

T

t0ster

Then give the user permission to access shared memory.

Why do you expect that Python would be able to over-ride the operating
system's security? This problem is no different from saying "It looks
like the user doesn't have permission to access this file".

Yes, your are right.
The problem was solved by chmoding /dev/shm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top