=== 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 | ||
Ztyx | I 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 |
---|---|---|
xnox | Ztyx: loop/wait the check for 60s in post-start, exit non-zero. that will stop the service. | 15:32 |
xnox | Ztyx: see (probably the most convoluted way to do so) in http://paste.ubuntu.com/7120379/ | 15:33 |
gena2x | Could anyone please tell how to set upstart env with result of shell command? | 15:38 |
gena2x | something like env DATE=$(date) | 15:38 |
Ztyx | xnox: 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 |
jodh | gena2x: is this for a system job, or a session job? | 15:39 |
gena2x | jodh, system job | 15:39 |
jodh | gena2x: 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 |
Ztyx | Also, will I need to reload upstart if I make changes to /etc/init/? | 15:40 |
gena2x | jodh, got it, thank you | 15:41 |
jodh | gena2x: 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 |
xnox | Ztyx: 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 |
xnox | Ztyx: it's not "post-exec" but rather "post-start" =) so you can do: post-start exec sleep 60; run-my-check | 15:42 |
xnox | Ztyx: 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 |
gena2x | jodh, ty once again, will put into script section, thats most clear solution in my case. | 15:44 |
Ztyx | xnox: 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 |
Ztyx | Originally, 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 |
xnox | Ztyx: correct, but you have set it to respawn. thus it just respawns again. | 15:56 |
xnox | Ztyx: if you want "exit 1" to stop it, and abort respawns, then you should do "stop; exit 1" | 15:57 |
xnox | Ztyx: see cookbook. | 15:57 |
xnox | Ztyx: or if you are testing, comment out the respawn / respawn limit | 15:57 |
Ztyx | xnox: I see. Goodo to know! | 16:01 |
Ztyx | xnox: Still seem to be running when I try this: https://gist.github.com/JensRantil/9644545 | 16:15 |
Ztyx | The only difference from previously is that I added "stop". | 16:16 |
Ztyx | The 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 |
Ztyx | Anyone 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!