Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stop getting <defunct> PIDs - How?

Status
Not open for further replies.

josel

Programmer
Oct 16, 2001
716
US
To allow our operators accessing OLD and NEW companies which
now reside in two different file systems, I wrote a simple script which runs as they log on

while true
do
trap "echo" 1 2 3 15
clear
echo "
Some menu options

"
read OPT
case "$OPT" in
1)
set filePro environment and run menu ;;
2)
set filePro environment and run menu ;;
0)
exit 1 ;;
esac
done

As you can see, operator will stay within this menu until
he/she presses 0 to exit.

This works fine but I am getting A LOT OF <defunct> PIDs.
Why is this? What am I doing wrong?

I am suspecting that they are simply closing their telnet
sessions using [X] on window and instead of exiting application
using X key and then 0 as mentioned above.

Any ideas?

Thanks;

Jose KNOWLEDGE: Something you can give away endlessly and gain more of it in the process! - Jose Lerebours
 
Perhaps because your trap is ignoring all of the signals that the parent process would use to close it. Try changing that to trap &quot;exit&quot; 1 2 3 15, that way if they try and break out of it it will presumably just log them off. Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top