cuisine icon indicating copy to clipboard operation
cuisine copied to clipboard

Troubles with celery

Open lejmr opened this issue 14 years ago • 6 comments

Hello guys, I am using cuisine in my project using celery. When I run the application in development and starting celery from command line ./manage.py celeryd ..... it works pretty well. But when I daemonize celery cuisine starts to not work.. the tricky part is popen for commands calling. It seems to me that the popen does not return the output and then my scripts fail.

But the most tricky part is that it works daemonized with ubuntu 10.10, python 2.7, supervisord 3 even with initd script .. When I move the same configuration to my production with ScientificLinux 6.2, python 2.6.6, supervisord 2/3, initd script - i tried everything .. popen returns "" instead of proper output..

I also created ticket at celery cause I assume this is more problem of celery running with Python 2.6.6. But I am putting this here to gather as much of people who could help me find the proper solution as possible :) If it was problem in cuisine I will write patch - definitely. https://github.com/ask/celery/issues/651

Thanks

lejmr avatar Mar 23 '12 12:03 lejmr

Hi, cause it was quite important step in my configuration so I put a lot of effort and the root problem is in sudo. Default sudo configuration at ScientificLinux is with this option: Defaults requiretty For me the easiest way was comment it out, so fortunately there is no need of patches

lejmr avatar Mar 24 '12 15:03 lejmr

Hello!

Do you mean that the run() or sudo() command gets stuck trying to read the output? Could you be more specific about the command you're having problem with, and ideally isolate a simple cuisine script that exercises the issue.

Thanks!

sebastien avatar Mar 24 '12 17:03 sebastien

Hello, actually it was problem with sudo command, but it can be mitigated by #Defaults requiretty in sudoers

Milos

lejmr avatar Mar 24 '12 17:03 lejmr

But a Idea come to me :) What about replacing popen with subprocess.Popen which can get stderr and then something can be done with such information...

lejmr avatar Mar 25 '12 16:03 lejmr

Hmm, it should work in all cases then -- what did you have in mind?

sebastien avatar Mar 25 '12 23:03 sebastien

If you mean subprocess.Popen it is suggested to be a substitute for os.popen which is generally not recommended to use in future.. But there is the thing cuisine does not handle stderr at all. I remember I was in situation I needed the stderr for some reason but I do not remember what was it particularly at this moment.. Anyway I think that it might be cool raise an exception carrying the stderr output. Then try can be used ...

But it is just an idea :D

lejmr avatar Mar 26 '12 00:03 lejmr