[00:16] zhilbert: you need 2 jobs to do that [00:17] zhilbert: one to iterate over the files in the dir, the other to be the actually running instances [02:30] Thanks SpamapS. I've got that part working. I think my issues are with daemon not with upstart. === tormod is now known as tormod_ === tormod_ is now known as tormod [16:31] hey, so I have a python daemon based on: http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/ [16:32] and the following upstart script [16:32] http://pastebin.com/qvkJqAuC [16:33] but it is hanging when i start/stop [16:33] i've tried with combinations of expect /fork/daemon but nothing seems to work [16:33] any ideas? [16:35] i have checked the command works normally in the terminal [16:35] so I am thinking its something to do with my upstart config [16:38] shaz_: that upstart config should return as soon as python is executed [16:38] shaz_: rather, 'starting' that upstart job [16:39] shaz_: however, the daemonize code you posted wants 'expect daemon' [16:40] shaz_: can you be more clear when you say "it is hanging" ? [16:40] I mean it doesn't ever return [16:41] as if you were running the blocking script in the terminal [16:41] i've just tried it with expect daemon [16:41] and it still does the same [16:42] I am doing all of this over ssh, if that makes a difference [16:42] shaz_: it does not make a difference no [16:44] shaz_: can you pastebin the output of 'strace -e trace=process -f /home/ubuntu/LoudPopcorn/venv/bin/python /home/ubuntu/LoudPopcorn/TwitterClient/streaming.py' ? [16:45] sure, give me a sec [16:46] http://pastebin.com/3NbCfpdF [16:46] shaz_: 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 python [16:46] shaz_: any chance you have a 'start on starting that-jobs-name' in some other job that blocks? [16:47] no i don't have that in any other scripts [16:49] shaz_: interesting. I think virtualenv may make using 'expect ...' impossible because of all the stuff it has to fork and exec first [16:49] shaz_: in this case, I'd suggest having a --nodaemonize mode for your code, and just let upstart manage it in the foreground [16:50] shaz_: also its worth noting that you need a 'setgid ubuntu' also.. [16:50] ok, i will give that a go. [16:50] ok [16:50] shaz_: 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:56] um, same thing when i run without daemon [16:56] (without expect daemon) [17:55] shaz_: 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 syslog