/srv/irclogs.ubuntu.com/2016/06/26/#upstart.txt

eranhey everyone06:31
eranis anyone available for some upstart help?06:31
eranhey again, is anyone alive?09:36
hallynirc is asynchronous - ask away, someone will most likely answer17:08
hallynoh s/he's gone17:08
eranhey18:35
AnrDaemoneran: Just ask your question and wait for answer. Peple are in tens of channels at once often.18:45
eransure, wasn't sure if anyone actually listens18:46
AnrDaemonDon't make me laugh, please.18:47
eranI'm running Ubuntu 14.04 with 1.12.1-0ubuntu4.218:47
eranI'm trying to setup an upstart script that starts a Python script18:48
AnrDaemon5 lines. Of which, 3 are informational.18:48
AnrDaemon2 are**18:48
eranthis Python script runs as a non-root user (it requires some environment settings).18:48
eranso I setup a sysV script to start/stop this python script18:49
AnrDaemonWell, add the lines for "non root user" and the environament you need.18:49
AnrDaemonEither way, pastebin your current state.18:49
eranok18:49
eranthis is my current upstart config file:18:51
eranhttp://pastebin.com/0Yngpsyw18:51
eranI can start/stop the service through /etc/init.d18:52
eranmy question is, how can I start an event after for example an ansible-playbook as finished18:52
AnrDaemonRemove "respawn"… Now. start on - don't you have any better events to start on?18:52
eranmy ansible-playbook runs on /etc/rc.local18:52
eranso I thought started on rc would be the place18:53
AnrDaemon*facepalm*18:53
eran:/18:53
eranand why remove respawn?18:53
AnrDaemonWhen you forget about existence of rc.local already?18:53
eranyeah well18:53
AnrDaemonBecause you don't have a working script yet.18:53
eranoh, ok 18:54
AnrDaemonAnd respawn is a good way to kill your system with a broken upstart.18:54
AnrDaemonjob18:54
erangood to know18:54
eranhow would you do it?18:54
AnrDaemonWrite upstart jobs for everything of course.18:55
eranfor both ansible-playbook command and the Python script?18:55
AnrDaemonIf you always need to start your script after that ansible thingy, the "start on stopped ansible-whatever"18:55
AnrDaemonOf course. Why such a question ever raised?18:56
=== JanC is now known as Guest5182
=== JanC_ is now known as JanC
eranok, sounds good18:57
eranother than that18:57
AnrDaemonIf your playbook is a short-living script, then makr it as "task".18:57
eranyeah, obviously18:57
AnrDaemonmark*18:57
eranthanks a lot, I will try this 18:57
eranI hope you're here tomorrow18:58
AnrDaemonAnd avoid wrapping your jobs in a script ... end script, if at all possible.18:58
AnrDaemonSomeone will answer, if you ask a question.18:58
eranI tried just using exec $DAEMON18:58
eranbut for some reason it failed starting18:58
AnrDaemon"console log" and look for clues.18:59
AnrDaemonAlso http://upstart.ubuntu.com/cookbook/18:59
eranjust out of curious, why script/end script is bad?18:59
AnrDaemonBecause upstart does not execute these scripts by itself, but call /bin/sh -e -c for that.19:00
AnrDaemonWhich means, it does not monitor correct PID from the beginning.19:00
eranok19:01
eranwhich leads me to the last question19:01
eranthe Python script is a wrapper for a C++ application19:02
eraneither way it won't know the correct PID, isn't it?19:02
eranalthough I use expect fork, daemon19:02
AnrDaemonSo, fork or daemon?19:03
eranfork19:03
AnrDaemonAs long as it monitoring correct PID in the end, should be fine.19:03
eranwill give it a try soon. 19:04
eranI appreciate your time19:04
AnrDaemonWhile you are "giving it a try", remove expect and respawn, both.19:05
AnrDaemonOr you may get upstart stuck and will need to reboot the box.19:05
eranwill do!19:05
eranthanks for your insight!19:05
eransee ya19:05

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