/srv/irclogs.ubuntu.com/2012/11/25/#upstart.txt

SpamapSzhilbert: you need 2 jobs to do that00:16
SpamapSzhilbert: one to iterate over the files in the dir, the other to be the actually running instances00:17
zhilbertThanks SpamapS.  I've got that part working. I think my issues are with daemon not with upstart. 02:30
=== tormod is now known as tormod_
=== tormod_ is now known as tormod
shaz_hey, so I have a python daemon based on: http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/16:31
shaz_and the following upstart script16:32
shaz_http://pastebin.com/qvkJqAuC16:32
shaz_but it is hanging when i start/stop16:33
shaz_i've tried with combinations of expect /fork/daemon but nothing seems to work16:33
shaz_any ideas?16:33
shaz_i have checked the command works normally in the terminal16:35
shaz_so I am thinking its something to do with my upstart config16:35
SpamapSshaz_: that upstart config should return as soon as python is executed16:38
SpamapSshaz_: rather, 'starting' that upstart job16:38
SpamapSshaz_: however, the daemonize code you posted wants 'expect daemon'16:39
SpamapSshaz_: can you be more clear when you say "it is hanging" ?16:40
shaz_I mean it doesn't ever return16:40
shaz_as if you were running the blocking script in the terminal16:41
shaz_i've just tried it with expect daemon16:41
shaz_and it still does the same16:41
shaz_I am doing all of this over ssh, if that makes a difference16:42
SpamapSshaz_: it does not make a difference no16:42
SpamapSshaz_: can you pastebin the output of 'strace -e trace=process -f /home/ubuntu/LoudPopcorn/venv/bin/python /home/ubuntu/LoudPopcorn/TwitterClient/streaming.py' ?16:44
shaz_sure, give me a sec16:45
shaz_http://pastebin.com/3NbCfpdF16:46
SpamapSshaz_: for the record, the upstart job you pasted makes it nearly impossible for 'start ...' to block.. because upstart will consider the job started immediately upon executing python16:46
SpamapSshaz_: any chance you have a 'start on starting that-jobs-name' in some other job that blocks?16:46
shaz_no i don't have that in any other scripts16:47
SpamapSshaz_: interesting. I think virtualenv may make using 'expect ...' impossible because of all the stuff it has to fork and exec first16:49
SpamapSshaz_: in this case, I'd suggest having a --nodaemonize mode for your code, and just let upstart manage it in the foreground16:49
SpamapSshaz_: also its worth noting that you need a 'setgid ubuntu' also.. 16:50
shaz_ok, i will give that a go.16:50
shaz_ok16:50
SpamapSshaz_: also its worth nothing that if this is a cloud instance, you should *NOT* run code as ubuntu (it has sudo w/o password)16:50
shaz_um, same thing when i run without daemon16:56
shaz_(without expect daemon)16:56
SpamapSshaz_: try 'sudo initctl log-priority info' ... note the last line in syslog, and then run the 'start' and then pastebin the lines produced by 'init:' in syslog17:55

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!