=== mclasen is now known as mclasen_afk === mclasen_afk is now known as mclasen [19:16] how do i specify in a script what to do when a service is stopped or restarted? [19:17] melter: depends on what that script does and how it relates to the script stopping [19:17] it's for a database [19:18] melter: what does it do? [19:18] 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] is there a complete upstart reference somewhere? [19:19] melter: man 5 init [19:23] 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] eventually, yes [19:24] so how do i safely shut down something important without data loss? [19:25] in pre-stop you'd quiesce it and halt it [19:26] sadmac: thanks [21:58] <@ahu> 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] 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] yeah, I can see why that'd be useful [23:12] "restart task when done if another start request came in while it was running" [23:17] Should also happen with start-inducing events including cron-like ones and state changes. [23:22] sure [23:22] same thing really [23:23] Yeah [23:25] my next two weeks are going to be trying to write down Upstart design stuff [23:25] draw pretty diagrams etc. [23:25] Alright