/srv/irclogs.ubuntu.com/2012/09/26/#upstart.txt

econnelli'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:16
SpamapSeconnell: does traffic_cop stay resident? if so, thats the process/group that will be tracked18:19
econnellyes, it does stay resident and it does not daemonize (i.e. no expect statement in the config)18:20
SpamapSthen that should behave as you'd expect.. kill to the process group18:20
econnellis that the default behavior?  to wait for all members of the process group before stopping?18:20
econnellyes, 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:21
SpamapSyeah I'm tracking down how job_process_terminate is called18:23
SpamapSgetting into libnih at that point18:24
SpamapSeconnell: ultimately traffic_cop should be killing and waiting for its own children...18:24
SpamapSeconnell: this is just a question of cleaning up and timing I guess18:24
SpamapSeconnell: it looks to me like only the main process would be waited on18:26
SpamapSeconnell: 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 way18:27
econnellyeah... 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 problems18:29
econnellis 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 suppose18:30
SpamapSeconnell: pgid == parent pid18:38
SpamapSeconnell: post-stop doesn't get called in the 'restart' action btw.. 18:38
econnellinteresting... i assumed restart == stop, then start... 18:40
econnellSpamapS: are you sure about that?   during restart i see: init: Handling stopping event18:55
SpamapSeconnell: stopping yes, but I don't believe post-stop is the next step19:09
SpamapSrestart is a little wonky19:09
SpamapSpre-stops aren't run19:10
econnellSpamapS: 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?19:39
SpamapSeconnell: it really is a corner case. Ideally the *parent* would not die till its children do20:00
SpamapSeconnell: sounds mostly like a bug in traffic_cop's signal handler20:00
econnellyeah.. i'm pestering the traffic server guys about it now too :)20:00
=== zz_Kiall is now known as Kiall
=== Kiall is now known as zz_Kiall

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