[06:31] <eran> hey everyone
[06:31] <eran> is anyone available for some upstart help?
[09:36] <eran> hey again, is anyone alive?
[17:08] <hallyn> irc is asynchronous - ask away, someone will most likely answer
[17:08] <hallyn> oh s/he's gone
[18:35] <eran> hey
[18:45] <AnrDaemon> eran: Just ask your question and wait for answer. Peple are in tens of channels at once often.
[18:46] <eran> sure, wasn't sure if anyone actually listens
[18:47] <AnrDaemon> Don't make me laugh, please.
[18:47] <eran> I'm running Ubuntu 14.04 with 1.12.1-0ubuntu4.2
[18:48] <eran> I'm trying to setup an upstart script that starts a Python script
[18:48] <AnrDaemon> 5 lines. Of which, 3 are informational.
[18:48] <AnrDaemon> 2 are**
[18:48] <eran> this Python script runs as a non-root user (it requires some environment settings).
[18:49] <eran> so I setup a sysV script to start/stop this python script
[18:49] <AnrDaemon> Well, add the lines for "non root user" and the environament you need.
[18:49] <AnrDaemon> Either way, pastebin your current state.
[18:49] <eran> ok
[18:51] <eran> this is my current upstart config file:
[18:51] <eran> http://pastebin.com/0Yngpsyw
[18:52] <eran> I can start/stop the service through /etc/init.d
[18:52] <eran> my question is, how can I start an event after for example an ansible-playbook as finished
[18:52] <AnrDaemon> Remove "respawn"… Now. start on - don't you have any better events to start on?
[18:52] <eran> my ansible-playbook runs on /etc/rc.local
[18:53] <eran> so I thought started on rc would be the place
[18:53] <AnrDaemon> *facepalm*
[18:53] <eran> :/
[18:53] <eran> and why remove respawn?
[18:53] <AnrDaemon> When you forget about existence of rc.local already?
[18:53] <eran> yeah well
[18:53] <AnrDaemon> Because you don't have a working script yet.
[18:54] <eran> oh, ok 
[18:54] <AnrDaemon> And respawn is a good way to kill your system with a broken upstart.
[18:54] <AnrDaemon> job
[18:54] <eran> good to know
[18:54] <eran> how would you do it?
[18:55] <AnrDaemon> Write upstart jobs for everything of course.
[18:55] <eran> for both ansible-playbook command and the Python script?
[18:55] <AnrDaemon> If you always need to start your script after that ansible thingy, the "start on stopped ansible-whatever"
[18:56] <AnrDaemon> Of course. Why such a question ever raised?
[18:57] <eran> ok, sounds good
[18:57] <eran> other than that
[18:57] <AnrDaemon> If your playbook is a short-living script, then makr it as "task".
[18:57] <eran> yeah, obviously
[18:57] <AnrDaemon> mark*
[18:57] <eran> thanks a lot, I will try this 
[18:58] <eran> I hope you're here tomorrow
[18:58] <AnrDaemon> And avoid wrapping your jobs in a script ... end script, if at all possible.
[18:58] <AnrDaemon> Someone will answer, if you ask a question.
[18:58] <eran> I tried just using exec $DAEMON
[18:58] <eran> but for some reason it failed starting
[18:59] <AnrDaemon> "console log" and look for clues.
[18:59] <AnrDaemon> Also http://upstart.ubuntu.com/cookbook/
[18:59] <eran> just out of curious, why script/end script is bad?
[19:00] <AnrDaemon> Because upstart does not execute these scripts by itself, but call /bin/sh -e -c for that.
[19:00] <AnrDaemon> Which means, it does not monitor correct PID from the beginning.
[19:01] <eran> ok
[19:01] <eran> which leads me to the last question
[19:02] <eran> the Python script is a wrapper for a C++ application
[19:02] <eran> either way it won't know the correct PID, isn't it?
[19:02] <eran> although I use expect fork, daemon
[19:03] <AnrDaemon> So, fork or daemon?
[19:03] <eran> fork
[19:03] <AnrDaemon> As long as it monitoring correct PID in the end, should be fine.
[19:04] <eran> will give it a try soon. 
[19:04] <eran> I appreciate your time
[19:05] <AnrDaemon> While you are "giving it a try", remove expect and respawn, both.
[19:05] <AnrDaemon> Or you may get upstart stuck and will need to reboot the box.
[19:05] <eran> will do!
[19:05] <eran> thanks for your insight!
[19:05] <eran> see ya