bash + defunct processes

B. S. sbremal@hotmail.com
Fri Oct 6 10:03:00 GMT 2006


Hi,

For a few days I have been struggling with bash scripts leaving defunct 
processes behind. The scripts are kicked off from crontab and are running in 
the background.

$ ps
      PID    PPID    PGID     WINPID  TTY  UID    STIME COMMAND
     1744    4384    1688       1744    ? 156894 18:26:16 <defunct>
     1224    1960    1736       3228    ? 156894 18:26:16 <defunct>
     4212       1    4212       4212  con 156894 18:26:31 /usr/bin/bash
     4488    4992    3480       8056    ? 156894 18:27:14 <defunct>
     8968    3340    6548       3968    ? 156894 18:28:15 <defunct>
     7112    8624    1872       5492    ? 156894 18:39:16 <defunct>
     9152    5048    9700       1980    ? 156894 18:38:35 <defunct>
      320    4212     320       3556  con 156894 18:46:16 /usr/bin/ps

Funny is that the script gets stuck at various points:

$ more /proc/<xxx>/winexename
C:\cygwin\bin\lynx.exe
C:\cygwin\bin\xmllint.exe
C:\cygwin\bin\rm.exe
C:\cygwin\bin\cp.exe
C:\cygwin\bin\date.exe

For each process there are 4-5 threads, one in state Wait::Executive and 
others in Wait::UserRequest (according to Process Explorer).

Have you got any idea what goes wrong?

(On top of this writing an automatic script to regularly clean up zombie 
processes is not straightforward since ps returns process IDs which are not 
accepted by kill...)

Any help is highly appreciated.

Cheers,
Balazs

_________________________________________________________________
Don't just search. Find. Check out the new MSN Search! 
http://search.msn.com/


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list