Steve Litt <sl...@troubleshooters.com> writes: [...]
> My opinion is that although this is indeed a bad thing, I'm > willing to risk it to get the breathtaking simplicity of Rich > Felker's vision in http://ewontfix.com/14/. Process #1 doesn't receive signals unless it installed a handler for them. This means blocking signals around the fork intended to confuse what the main operation of the program in question happens to be (reap orphaned processes) is useless. The setpgid(0, 0) does nothing because setsid already put the process into its own process group. A minimal variant of that which is less contorted and actually a valid C program could look like this: ---- #include <unistd.h> #include <sys/wait.h> int main(void) { if (getpid() != 1) return 1; if (fork() == 0) { setsid(); execve("/etc/rc", (char *[]){ "rc", 0 }, (char *[]){ 0 }); } while (1) wait(NULL); return 0; } ---- But don't let that deter from assuming that whoever screams the loudest must be the greated ... _______________________________________________ Dng mailing list Dng@lists.dyne.org https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng