Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!cbatt!ihnp4!houxm!hropus!jrw From: jrw@hropus.UUCP (Jim Webb) Newsgroups: net.unix-wizards Subject: Re: init and process group id's for SYS V Message-ID: <671@hropus.UUCP> Date: Thu, 11-Sep-86 11:32:58 EDT Article-I.D.: hropus.671 Posted: Thu Sep 11 11:32:58 1986 Date-Received: Fri, 12-Sep-86 05:32:54 EDT References: <541@chinet.UUCP> Organization: Bell Labs, Holmdel, NJ Lines: 27 > I am developing a kind of "auxiliary init" program for SYS V, that spawns gettys > for lines just being connected to a data switch. What sequence does > /etc/init use to spawn a getty (or whatever)? It execs "/bin/sh -c exec XXXXXXX" wherever XXXXXXX is the command from /etc/inittab. This allows you to use all of the shell special chars, redirection, etc. Note, however that you *cannot* have a pipe in there; I leave it up to the reader to see why not... > Also, how does /etc/init know which child process has died when it gets > a SIGCLD? According to the prog. manual, wait() gives you the status, > but not the process number. Read further. The wait() syscall does two things. One, which you point out, slams status info into the int pointed to as the argument. It also returns the pid of the child that terminated. Eg: pid=wait(&status); > Perhaps the process number is passed as an > additional argument to the signal catching function? Nope, the only argument passed to the catching function is the signal number. However, since this is UNIX, and full of contradictions, more arguments are passed if it is a hardware induced signal... -- Jim Webb "Out of phase--get help" ...!ihnp4!hropus!jrw