Help: How to kill pending process?

Help: How to kill pending process?

Post by Chao-Huang L » Thu, 11 Apr 1996 04:00:00



Hi,

I used to use "elm" to read mail. But it doesn't work recently.
After starting the "elm", it doesn't show anything just blank screen.
I deleted the /etc/spool/mail/clin.lock file and run "elm" again,
but it won't work too.

The worse thing is that I couldn't use "kill -9" to kill the "elm"
process. Hope you could help me to kill  the pending "elm" process.

The OS I use is SunOS 4.1.3. Below is the list from "ps -waux".

USER       PID %CPU %MEM   SZ  RSS TT STAT START  TIME COMMAND
clin     10093  0.0  0.5  168  648 ?  S    Apr  5  0:01 elm
clin      7797  0.0  0.5  168  652 ?  S    Apr  1  0:00 elm
clin      7463  0.0  0.5  168  648 ?  S    Apr  1  0:00 elm
clin     12046  0.0  0.5  168  652 ?  S    08:55   0:00 elm

Thank you very much

Chao-Huang Lin
4/10/85

 
 
 

1. How can kill all child processes without killing parent process ?

: Hi all UNIX expert,

: I am now writing a shell script to kill all child processes of a
: particular process.  I have written the following
: script:

: ps -ef | grep o\\ra  | awk '{print $2}' | xargs kill

: where ora is the name of the parent process

: However, this shell script only kills out the parent process,
: Does anyone know how to kill all child process without
: killing that parent process ? Please advise !!! Many thanks !!!
: Have a nice UNIX day !!!

you will have to read all matching processes and only kill the last in the
chain by using PID and PPID; unfortunately we can not assume that the
child is the process with the highest PPID:
assume $2=PID , $3=PPID ( coming from   ps -ef | grep o\\ra  | grep -v grep )

{
        PID[ $2 ]=""
        PPID[ $3 ]=""

END{
# process ids which are also parents should be deleted
        for( pid in PPID ) if ( pid in PID ) delete PID[ pid ]
        for( pid in PID ) { do_whatever_you_like_on_your_own_risk( pid ) }
        }

function do_whatever_you_like_on_your_own_risk( param ){
        code...
        }

2. Unix Adm training, where?

3. A method to kill process that cannot be killed even with `kill -9'.

4. SCSI timeout during install.... :-(

5. How to kill process which not killed by 'kill' ?

6. apt-get kde 3.1 error

7. Help: kill sub-process after parent killed

8. multiple kdm/kwm ?

9. How to Kill Process and Its sub-process and its sub-process??

10. How to Kill a process and its sub-process and its sub-process at a time..

11. killing dead process, kill -9 doesn′t work

12. how to kill a process when kill -9 won't

13. Kill -9 won't kill a process