Comment 1 for bug 1358753

Revision history for this message
Ted Gould (ted) wrote :

I was asked, so I thought I'd put the comment here as well. Here's how you avoid the application lifecycle:

int main (int argc, char * argv[]) {
  pid_d pid = 0;
  if ((pid = fork()) != 0) {
    waitpid(pid);
    return 0;
  |
  setpgid(0,0);

  /* You're free!!!!! */
}

The parent will get stopped and started based on application lifecycle states but anything in the rest of the main function will be unaffected.