Browse Source

Adds FAQ entry for Issue #651

Ask Solem 13 years ago
parent
commit
70f08cd62d
2 changed files with 21 additions and 6 deletions
  1. 16 0
      FAQ
  2. 5 6
      celery/bin/celery.py

+ 16 - 0
FAQ

@@ -457,6 +457,22 @@ How can I reuse the same connection when applying tasks?
 **Answer**: See the :setting:`BROKER_POOL_LIMIT` setting.
 The connection pool is enabled by default since version 2.5.
 
+.. _faq-sudo-subprocess:
+
+Sudo in a :mod:`subprocess` returns :const:`None`
+-------------------------------------------------
+
+There is a sudo configuration option that makes it illegal for process
+without a tty to run sudo::
+
+    Defaults requiretty
+
+If you have this configuration in your :file:`/etc/sudoers` file then
+tasks will not be able to call sudo when celeryd is running as a daemon.
+If you want to enable that, then you need to remove the line from sudoers.
+
+See: http://timelordz.com/wiki/Apache_Sudo_Commands
+
 .. _faq-deletes-unknown-tasks:
 
 Why do workers delete tasks from the queue if they are unable to process them?

+ 5 - 6
celery/bin/celery.py

@@ -170,9 +170,9 @@ amqp = create_delegate("amqp", "celery.bin.camqadm:AMQPAdminCommand")
 class list_(Command):
     args = "[bindings]"
 
-    def list_bindings(self, channel):
+    def list_bindings(self, management):
         try:
-            bindings = channel.list_bindings()
+            bindings = management.get_bindings()
         except NotImplementedError:
             raise Error("Your transport cannot list bindings.")
 
@@ -180,8 +180,8 @@ class list_(Command):
                                                      e.ljust(28), r))
         fmt("Queue", "Exchange", "Routing Key")
         fmt("-" * 16, "-" * 16, "-" * 16)
-        for binding in bindings:
-            fmt(*binding)
+        for b in bindings:
+            fmt(b["destination"], b["source"], b["routing_key"])
 
     def run(self, what=None, *_, **kw):
         topics = {"bindings": self.list_bindings}
@@ -193,8 +193,7 @@ class list_(Command):
                             what, available))
         with self.app.broker_connection() as conn:
             self.app.amqp.get_task_consumer(conn).declare()
-            with conn.channel() as channel:
-                return topics[what](channel)
+            topics[what](conn.manager)
 list_ = command(list_, "list")