[19:16] <melter> how do i specify in a script what to do when a service is stopped or restarted?
[19:17] <sadmac> melter: depends on what that script does and how it relates to the script stopping
[19:17] <melter> it's for a database
[19:18] <sadmac> melter: what does it do?
[19:18] <melter> starts the database at boot and shuts it down when the server is rebooted; i've also got other scripts, but that's the one i'm re-writing atm
[19:19] <melter> is there a complete upstart reference somewhere?
[19:19] <sadmac> melter: man 5 init
[19:23] <melter> it looks like pre-stop will work, but what does "It will be run before the job's stopping(7) event is emitted and before the main process is killed." mean? Will a stop command kill my database process?
[19:23] <sadmac> eventually, yes
[19:24] <melter> so how do i safely shut down something important without data loss?
[19:25] <sadmac> in pre-stop you'd quiesce it and halt it
[19:26] <melter> sadmac: thanks
 classic 'One of our Google Summer of Code students took this to heart and implemented a binary search that was unfortunately not only incorrect but also slower than the linear search'
[23:11] <ion> keybuk: It might be nice to have watershed-like functionality for tasks. ‘start foo’ if foo is already running would OR the ‘start_again’ flag for the instance with TRUE and when the instance stops, it would be started again if start_again is true.
[23:12] <Keybuk> yeah, I can see why that'd be useful
[23:12] <Keybuk> "restart task when done if another start request came in while it was running"
[23:17] <ion> Should also happen with start-inducing events including cron-like ones and state changes.
[23:22] <Keybuk> sure
[23:22] <Keybuk> same thing really
[23:23] <ion> Yeah
[23:25] <Keybuk> my next two weeks are going to be trying to write down Upstart design stuff
[23:25] <Keybuk> draw pretty diagrams etc.
[23:25] <ion> Alright