Permalink
Browse files

Place process tracker in its own process group

  • Loading branch information...
snoyberg committed Nov 19, 2012
1 parent c1e49dc commit 02a85413aa65003d9a7f11684f7c76621017ded0
Showing with 5 additions and 0 deletions.
  1. +5 −0 cbits/process-tracker.c
View
@@ -59,8 +59,13 @@ extern int launch_process_tracker(void) {
else if (child == 0) {
unsigned int buffer[2];
struct node *n = 0, *n2;
+
close(pipes[1]);
+ // Prevent monitoring programs like Upstart from killing this
+ // new process along with the parent
+ setpgid(0, 0);
+
while (read(pipes[0], buffer, sizeof(unsigned int) * 2) > 0) {
if (buffer[1]) {
//printf("Adding node %d\n", buffer[0]);

0 comments on commit 02a8541

Please sign in to comment.