Xref: utzoo comp.unix.questions:6767 comp.unix.wizards:8133 comp.unix.microport:556 Path: utzoo!utgpu!water!watmath!clyde!wtr@moss.ATT.COM From: wtr@moss.ATT.COM Newsgroups: comp.unix.questions,comp.unix.wizards,comp.unix.microport Subject: Re: Trouble killing processes in SysV/AT Message-ID: <25567@clyde.ATT.COM> Date: 29 Apr 88 12:48:59 GMT References: <3950@killer.UUCP> <3951@killer.UUCP> Sender: lp@clyde.ATT.COM Reply-To: wtr@moss.UUCP (Bill Rankin) Organization: AT&T Bell Laboratories, Whippany NJ Lines: 35 In article <3951@killer.UUCP> wnp@killer.UUCP (Wolf Paul) writes: >Can anyone enlighten me as to what causes a process to become "immortal" >in System VR2, or Microport UNIX System V/AT, to be more specific? basically the way i do it is to have a shell script that runs something in the background. when the shell script puts the process in the backgroun and goes about it's merry own way, (which usually means exiting back out), the background process spawned from the script is given the PPID of 1 because it's former parent is now dead. i've used this to great advantage when i want to run a background job from a terminal, and then logoff and go somewhere else. (yes, I know about nohup, it's priority is too low, and i need to route my standard output, this ways easier) >I have encountered this a number of times, where it would be impossible >even for root to kill a process; if the parent process of the "immortal" >process is killed, the child attaches itself to init, PID 1. > >What causes a process to refuse to die? I thought signal 9 (kill) could >not be intercepted or ignored? wait! don't touch that reset button! there is life beyond shells! you can kill the process (either by root or by the user who started it) but you MUST kill of not only the process, but also all of it's children too! (mass genocide!! ;-) if you dont, any child process under the 'immortal script' is given a new PPID of 1 and thus itself becomes immortal, and may spawn and produce children itself, etc... whip out you trusty 'kill -9' and gun down those suckers! note: the massacre outlined above will produce really nasty effects if the process was any sort of compile, ESPECIALLY a makefile run. good hunting!