/srv/irclogs.ubuntu.com/2013/11/05/#upstart.txt

=== Md_ is now known as Md
myndzii'm trying to create an upstart script that lets me gracefully exit a program00:37
myndzibut in pre-stop a while loop that doesn't exit until the script is ready doesn't appear to be working00:37
myndzihttp://pastie.org/private/3usocsfi2u74kijm85iqoa00:38
myndziany idea what's wrong?00:38
myndziit appears to work fine if i make a bash script and run it00:40
xnoxmyndzi: [[ is bashism. https://wiki.ubuntu.com/DashAsBinSh#A.5B.5B01:02
xnoxmyndzi: upstart uses /bins/sh, "dash" specifically on ubuntu.01:02
myndzithat explains it02:25
myndziafter a lot of messing around i got something that works and is clean :)02:25
myndzithanks02:25
quickdry21I've been tackling the problem of running multiple processes from the same upstart script, any thoughts on this? https://gist.github.com/quickdry21/731284102:44
stgraberquickdry21: you should look into upstart instances and use that instead of calling start-stop-daemon from a single job03:09
stgraber(so split into two jobs, one doing the for loop and spawning an instance of the other for each entry)03:10
quickdry21stgraber: would like to see an example of the upstart job that starts multiple single-upstart jobs... i've gotten the single-job to work but have had problems getting a loop to start other job with the script ending03:16
stgraberquickdry21: http://paste.ubuntu.com/6362512/03:20
quickdry21Nice - thanks, I'll be playing around with that. I knew start-stop-daemon was a bad way to to it.03:26
stgraberdoing it with instances also lets you use the respawn keyword and per-instance pre-start/pre-stop/post-start/post-stop scripts just like with a standard job03:27
StrikiI was wondering if there is a way to make sure one service does not stop until another service is stopped? As an example. We have task workers running in AWS and they are being auto scaled. So when AWS issues the shutdown command, celeryd (the task worker daemon), shuts down gracefully. I must make sure that mongos does not shut down before celeryd has been able to finish the tasks it's cleaning up.14:19
StrikiI've looked at stop on stopped.. start on started.. etc. - but haven't found the right way14:19
Strikiif I write in the task worker upstart "stop on stopping mongos" - would that ensure the task worker is stopped before mongos finishes shutting down?14:36
xnoxStriki: yes.14:51
xnoxStriki: there is a table of events & order they are emitted in.14:51
xnoxStriki: stopping mongos is emitted once it was decided that "mongos" should stop. At that point everything this is "on stopping mongos" should succeed, before mongos is actually stopped.14:52
xnoxStriki: but, i"m not sure how that will help you in the shutdown case, I thought there is a timeout after which everything gets killed, but you should have 5 seconds or so.14:53
xnoxnot sure that one can block shutdown.14:53
xnoxjodh: can one block shutdown, whilst "stop on" haven't completed yet?14:53
jodhxnox: not reliably since Upstart doesn't handle the final shutdown atm. - /etc/init.d/sendsigs does.14:56
jodhStriki: see upstart-events(7) / http://upstart.ubuntu.com/cookbook/#ubuntu-well-known-events-ubuntu-specific for a list of events14:57
Strikixnox: ok thank you a lot!15:25
Strikiand you as well jodh 15:26
rcassidyhi all! quick q: any way to reliably log who is using initctl to start/stop an upstart job?20:28
rcassidy(note: sadly, this is also a painfully old version of upstart.)20:29
xnoxrcassidy: not sure how would that work. But if you increase logging you will see when jobs where started/stopped.21:06
xnoxrcassidy: to do so, one needs to be root. So check/correlate with sudo logs.21:06
xnox"to do so" to stop/start jobs.21:07
xnoxrcassidy: if you have custom policykit rules that you allow certain people start/stop certain jobs, check policy kit logs when those requests were granted and to who.21:07
rcassidyxnox: thanks for reply!21:08
rcassidyi think the best bet right now is to correlate with root logs, yes - thanks!21:08

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