Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Kill defunct process without root
Name: Henk Date: November 26, 2002 at 05:00:57 Pacific OS: HP-UX 10.20 CPU/Ram: 3 1024
Comment:
Hello,
i have made a script who will kill all processe with defunct. but in the kill-list are the entry from my grep-command :-(
Itīs possible to extract the list without the root-user?
My svript:
#!/bin/ksh PATH=/usr/bin:/bin export PATH user='defunct' #this could be a program name also proclist=`ps -ef | grep $user | cut -c16-20` rm -f /tmp/delpid echo "cron script running on \c" >>/tmp/delpid uname -a >>/tmp/delpid echo "Following processes removed for $user" >>/tmp/delpid date >>/tmp/delpid echo "PASS 1 - cleanup" >>/tmp/delpid for proc in $proclist;do kill $proc echo "kill $proc" >>/tmp/delpid done sleep 30 #wait thirty seconds to give stuff a chance to die echo "PASS 2 - double check (should be blank below)" >>/tmp/delpid proclist=`ps -ef | grep $user | cut -c16-20` for proc in $proclist;do kill -9 $proc echo "kill -9 $proc" >>/tmp/delpid done mail admin_user # rm -f /tmp/delpid
Summary: Just to clarify matters on ZOMBIE/defunct processes. This is the normal life of a program. fork()INIT->exec()->RUN->exit()->ZOMBIE->done INIT(fork) The program is started by a parent process, an act...
Summary: Robbo, Please. Windows as the best OS? Give me break. Unix has processes running as services outside of the OS and allows you to SIGHUP or even kill the process without rebooting your computer or ch...