/srv/irclogs.ubuntu.com/2012/08/02/#upstart.txt

jMCghow do I tell upstart's stop to kill all children of a process too?00:59
jMCghttps://git-wip-us.apache.org/repos/asf?p=trafficserver.git;a=blob_plain;f=rc/trafficserver.conf.in;hb=HEAD01:00
jMCgHRM. I don't have expect fork in my version. Maybe that's it.01:01
jMCgOy, no answer here :-/16:46
SpamapSjMCg: IIRC upstart will kill the entire "process group"16:57
jMCgSpamapS: but it doesn't16:59
SpamapSjMCg: actually no, I see now, it just kills the tracked pid17:01
jMCgSpamapS: sometimes I miss SMF17:01
SpamapSjMCg: really though, a parent that doesn't kill its children off on SIGTERM is misbehaving. ;)17:05
SpamapSjMCg: ok, so if I understand my "process group" mechanics correctly, kill() to a pid that is a process group leader will be delivered to all process group members.17:08
SpamapShrm no I misread that17:23
SpamapShave to send to -pid to get the process group17:23
jMCgSpamapS: thing is, this is a controll process, and it's children, so really, what I need is a way to tell upstart how *really* to reload or restart the. thing.17:34
SpamapSjMCg: you can change the normal kill signal17:34
SpamapSunfortunately, not the reload signal17:34
SpamapSjMCg: so if SIGTERM is too violent/handled poorly by that process.. then you canchange to whatever is the more graceful way to shutdown17:35
SpamapSbut ultimately, SIGHUP needs to be handled well17:35
jMCgSpamapS: I'll have to discuss that with my peers, the thing is: We start traffic_cop in upstart, whic starts traffic_manager, which starts traffic_server which oh fuck me.17:35
jMCgI mean, gimme a sec, I might have done something wrongishly.17:36
jMCghttps://issues.apache.org/jira/browse/TS-75517:36
jMCgOkay, that doesn't really affect anything here.17:37
jMCgMaybe I need to tell upstart to expect fork?17:37
jMCgLemme try that.17:38
* SpamapS reads upstart code again17:38
jMCgYes, I do need to do that. As I correctly do in the code I have up on apache's git ;)17:39
jMCgSo why did I do it wrong in my installation? I don't know.17:39
jMCgOf course this is a really not very graceful way of restarting the thing.17:40
SpamapSjMCg: ok, I can confirm, upstart kills the whole process group / session17:40
SpamapS    if (kill (pgid > 0 ? -pgid : pid, signal) < 0)17:40
SpamapS        nih_return_system_error (-1);17:40
jMCgSpamapS: with expect fork, or even without?17:40
SpamapSjMCg: no matter what17:41
SpamapSexpect fork just helps it figure out the pid17:41
SpamapSjMCg: actually, reload does not send to the group17:43
SpamapS    if (kill (processes[0]->item1, SIGHUP) < 0) {17:43
SpamapSwhich makes sense17:43
SpamapSits not trying to clean up, its trying to tell the main process to reload its configuration17:43
jMCgSpamapS: I need to test if this will work, and if does, adapt a new workflow.17:45
jMCgSpamapS: it would appear as though it works!17:47
SpamapSjMCg: \o/17:49
jMCgWe did something right in our code!17:51

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