Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9280627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T17:55:03+00:00 2026-06-18T17:55:03+00:00

I have a process running as root that needs to spin threads off to

  • 0

I have a process running as root that needs to spin threads off to be run as various users. This part is working fine, but I need a way to communicate between the child processes and the parent process.

When I try using multiprocessing.Manager() with some lists, dictionary, Lock, Queue, etc, it always has permission denied errors on the process that has lowered permissions.

Is there a way to grant access to a user or PID to fix this?

Basic code that represents what I’m running into (run as root):

#!/usr/bin/env python
import multiprocessing, os
manager = multiprocessing.Manager()
problematic_list = manager.list()
os.setuid(43121) # or whatever your user is
problematic_list.append('anything')

Result:

root@liberator:/home/bscable# python asd.py
Traceback (most recent call last):
  File "asd.py", line 8, in <module>
    problematic_list.append('anything')
  File "<string>", line 2, in append
  File "/usr/lib/python2.7/multiprocessing/managers.py", line 755, in _callmethod
    self._connect()
  File "/usr/lib/python2.7/multiprocessing/managers.py", line 742, in _connect
    conn = self._Client(self._token.address, authkey=self._authkey)
  File "/usr/lib/python2.7/multiprocessing/connection.py", line 169, in Client
    c = SocketClient(address)
  File "/usr/lib/python2.7/multiprocessing/connection.py", line 293, in SocketClient
    s.connect(address)
  File "/usr/lib/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
socket.error: [Errno 13] Permission denied
Traceback (most recent call last):
  File "/usr/lib/python2.7/multiprocessing/util.py", line 261, in _run_finalizers
    finalizer()
  File "/usr/lib/python2.7/multiprocessing/util.py", line 200, in __call__
    res = self._callback(*self._args, **self._kwargs)
  File "/usr/lib/python2.7/multiprocessing/managers.py", line 625, in _finalize_manager
    process.terminate()
  File "/usr/lib/python2.7/multiprocessing/process.py", line 137, in terminate
    self._popen.terminate()
  File "/usr/lib/python2.7/multiprocessing/forking.py", line 165, in terminate
    os.kill(self.pid, signal.SIGTERM)
OSError: [Errno 1] Operation not permitted

The first exception appears to be the one that is important here.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T17:55:04+00:00Added an answer on June 18, 2026 at 5:55 pm

    Python (at least 2.6) uses a UNIX socket to communicate that appears like so:

    /tmp/pymp-eGnU6a/listener-BTHJ0E
    

    We can grab that path and change the permissions on it like so:

    #!/usr/bin/env python
    import multiprocessing, os, grp, pwd
    manager = multiprocessing.Manager()
    problematic_list = manager.list()
    
    fullname = manager._address
    dirname = os.path.dirname(fullname)
    
    gid = grp.getgrnam('some_group').gr_gid
    uid = pwd.getpwnam('root').pw_uid # should always be 0, but you never know
    
    os.chown(dirname, uid, gid)
    os.chmod(dirname, 0770)
    
    os.chown(fullname, uid, gid)
    os.chmod(fullname, 0770)
    
    os.setgid(gid)
    os.setuid(43121) # or whatever your user is
    problematic_list.append('anything')
    

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a long running process that is called via a Nancy Module Get
I have a process that is running as a java daemon on Ubuntu Linux.
I have a process running under Windows Server 2003 SP2. When I want to
I have running process but it's executable file has got deleted. If I try
I have a python process running now , but it hangs with no log、no
I basically have a unix process running and it is doing some heavy processing
Imagine I have an existing process running under windows as a particular user. Would
i have application who use specific process during running and i want to sample
I have an application for PDAs with a long running process, and I'm getting
I have a situation where user requests to do a long running process. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.