[18:16] i'm trying to create a config for apache traffic server, and it behaves a bit odd. you exec a program called traffic_cop which then spawns 2 other processes. Is there a way to wait for all processes within the process group to terminate before declaring the job as stopped? (running upstart 1.5-0ubuntu7) [18:19] econnell: does traffic_cop stay resident? if so, thats the process/group that will be tracked [18:20] yes, it does stay resident and it does not daemonize (i.e. no expect statement in the config) [18:20] then that should behave as you'd expect.. kill to the process group [18:20] is that the default behavior? to wait for all members of the process group before stopping? [18:21] yes, i see the kill signal is sent to the group, but it appears to only wait for the main tracked process to stop rather than all processes in the group (i think... it's hard to tell) [18:23] yeah I'm tracking down how job_process_terminate is called [18:24] getting into libnih at that point [18:24] econnell: ultimately traffic_cop should be killing and waiting for its own children... [18:24] econnell: this is just a question of cleaning up and timing I guess [18:26] econnell: it looks to me like only the main process would be waited on [18:27] econnell: I believe if traffic_cop exits without waiting for its children, pid 1 will inherit them as zombies and then they'll be cleaned up in the normal zombie cleanup way [18:29] yeah... that's happening, the actual problem i'm trying to solve is with restarting the job... the timing causes it to occasionally try to start traffic_cop before the children are killed, which causes some other weird problems [18:30] is there a way to determine what the pgid that's being tracked is in a script? if so, i could hack a post-stop script that waits i suppose [18:38] econnell: pgid == parent pid [18:38] econnell: post-stop doesn't get called in the 'restart' action btw.. [18:40] interesting... i assumed restart == stop, then start... [18:55] SpamapS: are you sure about that? during restart i see: init: Handling stopping event [19:09] econnell: stopping yes, but I don't believe post-stop is the next step [19:09] restart is a little wonky [19:10] pre-stops aren't run [19:39] SpamapS: alright... i got it working... but this is kinda hackish... can i suggest a feature to have an option to wait for everything in the process group to die? [20:00] econnell: it really is a corner case. Ideally the *parent* would not die till its children do [20:00] econnell: sounds mostly like a bug in traffic_cop's signal handler [20:00] yeah.. i'm pestering the traffic server guys about it now too :) === zz_Kiall is now known as Kiall === Kiall is now known as zz_Kiall