Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!mit-eddie!genrad!decvax!ucbvax!sdcsvax!hutch From: hutch@sdcsvax.UCSD.EDU (Jim Hutchison) Newsgroups: comp.unix.wizards Subject: Programming around zombies (Was Re: Zombies ???) Message-ID: <2290@sdcsvax.UCSD.EDU> Date: Tue, 9-Dec-86 18:23:55 EST Article-I.D.: sdcsvax.2290 Posted: Tue Dec 9 18:23:55 1986 Date-Received: Wed, 10-Dec-86 05:34:35 EST References: <1327@brl-adm.ARPA> <165@hqda-ai.UUCP> Reply-To: hutch@sdcsvax.UUCP (Jim Hutchison) Organization: UCSD EMU Project (Educational Microcomputer Unix) Lines: 29 <> Setting SIGCHLD to SIGIGN will cause init to adopt your poor child and let it exit in peace. This works under sys III (PC/IX), and berkeley 4.3, no others verified. Here is a sample program (its real short). #include #include main() { if (fork() == 0) { /* seperate noodles */ if ((long)signal(SIGCHLD,SIG_IGN) == -1L) { /* Ignored child */ fprintf(stderr,"Signal failed in child\n"); exit(-1); } puts("Child waiting"); sleep(5); /* for parent to exit */ puts("Bye bye"); exit(0); } puts("Parent Bails"); exit(0); } -- = Jim Hutchison UUCP: {dcdwest,ucbvax}!sdcsvax!hutch ARPA: Hutch@sdcsvax.ucsd.edu panic -- no witty phrase