ソースを参照

celery.platforms: Do actually set effective uid/gid

Ask Solem 14 年 前
コミット
b86bb1be89
1 ファイル変更4 行追加1 行削除
  1. 4 1
      celery/platforms.py

+ 4 - 1
celery/platforms.py

@@ -167,7 +167,8 @@ class DaemonContext(object):
             self._is_open = False
 
 
-def create_daemon_context(logfile=None, pidfile=None, **options):
+def create_daemon_context(logfile=None, pidfile=None, uid=None, gid=None,
+        **options):
     if not CAN_DETACH:
         raise RuntimeError(
                 "This platform does not support detach.")
@@ -175,6 +176,8 @@ def create_daemon_context(logfile=None, pidfile=None, **options):
     # Make sure SIGCLD is using the default handler.
     reset_signal("SIGCLD")
 
+    set_effective_user(uid=uid, gid=gid)
+
     # Since without stderr any errors will be silently suppressed,
     # we need to know that we have access to the logfile.
     if logfile: