/srv/irclogs.ubuntu.com/2014/03/19/#upstart.txt

=== hidgw is now known as dgw
=== marcoceppi is now known as marcoceppi-mobil
=== marcoceppi-mobil is now known as marcoceppi
=== marcoceppi is now known as marco-traveling
ZtyxI have a "post-start exec" to check my process is fully up. Can "post-start exec" stop my service if it doesn't come up in say, 60 seconds?15:30
xnoxZtyx: loop/wait the check for 60s in post-start, exit non-zero. that will stop the service.15:32
xnoxZtyx: see (probably the most convoluted way to do so) in http://paste.ubuntu.com/7120379/15:33
gena2xCould anyone please tell how to set upstart env with result of shell command?15:38
gena2xsomething like env DATE=$(date)15:38
Ztyxxnox: Thanks for give me a push in the right direction. My exec application most certainly exits with 1. I even added a sleep in it just to make sure this wasn't a timing issue. Will I need to use a "post-exec script" for this?15:38
jodhgena2x: is this for a system job, or a session job?15:39
gena2xjodh, system job15:39
jodhgena2x: in which case there isn't really a good way. Either define DATE in your script sections (all of them that need to use $DATE!) or have each script section source /etc/default/myservice.15:40
ZtyxAlso, will I need to reload upstart if I make changes to /etc/init/?15:40
gena2xjodh, got it, thank you15:41
jodhgena2x: alternatively, have another job emit an event ('initctl emit my-event DATE=... hello=world') that your job can 'start on' and thus get the value of that event's variables.15:41
xnoxZtyx: configs are re-read automatically, but they are applied against /newly/ started jobs only. E.g. if the job is running, you'd need to do: stop myjob; start myjob => for changes to take effect.15:41
xnoxZtyx: it's not "post-exec" but rather "post-start" =) so you can do: post-start exec sleep 60; run-my-check15:42
xnoxZtyx: that means it will always take 60s to start, the check would run, and if check exits 0 -> all is good your job is started. Otherwise the job will stop.15:43
gena2xjodh, ty once again, will put into script section, thats most clear solution in my case.15:44
Ztyxxnox: see any errors in this https://gist.github.com/JensRantil/9644545 Seem like it should shut down my application after 10 seconds, right?15:46
ZtyxOriginally, I tried this https://gist.github.com/JensRantil/9644643 but after looking at the mysql.conf I tried the "post-start script" version.15:50
xnoxZtyx: correct, but you have set it to respawn. thus it just respawns again.15:56
xnoxZtyx: if you want "exit 1" to stop it, and abort respawns, then you should do "stop; exit 1"15:57
xnoxZtyx: see cookbook.15:57
xnoxZtyx: or if you are testing, comment out the respawn / respawn limit15:57
Ztyxxnox: I see. Goodo to know!16:01
Ztyxxnox: Still seem to be running when I try this: https://gist.github.com/JensRantil/964454516:15
ZtyxThe only difference from previously is that I added "stop".16:16
ZtyxThe cookbook contains examples for this for pre-start, but I can't find anything like this for post-start. Also, I've tried both "exit 1" and "exit 2" since http://paste.ubuntu.com/7120379/ seem to use both. Still nothing.16:27
ZtyxAnyone else with some input as to why my application isn't stopped? Is this supported?16:36
esperegu_I would like to start a program after pulseaudio is started. there is not upstart script for pulseaudio but only a script in /etc/init.d/ does that also get monitored and if so what should be the condition for the on start entry?19:14

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