defunct vs running


 
Thread Tools Search this Thread
Top Forums Programming defunct vs running
# 1  
Old 12-30-2008
defunct vs running

hello everybody!
Is there any way to identify if a process is defunct or if it is still running? (in C).
for example: by using a signal such as SIGCHLD?
thanx in advance
# 2  
Old 12-30-2008
The easiest way to check if a process/child is a zombie/defunct is to read almost any entry from /proc/PID/.
If you read /proc/pid/status you will see
Code:
Name: defunct
State: Z (zombie)

/proc/pid/stat will be:
Code:
PID (defunct) Z ...

reads to /proc/pid/mem will fail
cwd, root and exe symbolic links will be broken.
cmdline will be empty.

Choose one.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. HP-UX

How to clear defunct processes??

How to find out and clear the 'defunct' processes at OS and DB level ..?? (6 Replies)
Discussion started by: SurajR
6 Replies

2. UNIX for Advanced & Expert Users

defunct processes?

HiI had a tool fail recently, on analysis I found it was cleaning up orphaned directories that had been created by specific processes that had died for some reason, thus failing to clean up after themselves.The directories were of the form /dir.pid. The tool would look to see if any instances of... (2 Replies)
Discussion started by: steadyonabix
2 Replies

3. HP-UX

Defunct processes are getting generated

Dear Sir / Madam, We have two socket programs which are running in background. These two socket programs are creating defunct processes in HP-UX which were not happening in Compaq True64 UNIX. What is the root cause of these defunct processes and how can we correct it? Your suggestion will be... (3 Replies)
Discussion started by: kcsahoo
3 Replies

4. Programming

Why am I getting a defunct process/pipes?

#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <fcntl.h> #include <string.h> #include <sys/wait.h> #include <sys/types.h> #include <stdint.h> #define LINE_MAX 80 int main() { pid_t pid, pid1; char line; char *lines; char *key, *data,... (2 Replies)
Discussion started by: p00ndawg
2 Replies

5. Solaris

Defunct process

My system is running solaris zones and oracle dbs in all the zones .. and now i find more then 4500 defunct processes in ps output. Can anyone know about this how to kill these # ps -ef | grep defunct | wc -l 4899 And when i do ptree on one of the pid it shows most of the defunct... (3 Replies)
Discussion started by: fugitive
3 Replies

6. AIX

Defunct Processes

Hi, Can any one help me to get rid of defunct process on UNIX IBM AIX box. These processes started when the system was rebooted almost after 1 1/2 years. Once one defunct process is created then all the user ids get infected and in turn creates numerous defunct processes. We have tried... (6 Replies)
Discussion started by: trokia88
6 Replies

7. UNIX for Dummies Questions & Answers

Question about defunct processes

Hey guys/gals. I am new to the site and fairly new to Unix/Linux. I have a master netbackup server (solaris) that I get pinged on occasionally regarding defunct processes. (Usually over 50 or so of them.) I know what a defunct process is, but what is it a product of? Just plain sloppy code? (From... (1 Reply)
Discussion started by: EMCSANMAN
1 Replies

8. UNIX for Advanced & Expert Users

defunct process on HP

Hi unix lovers, i have question about defunt process on HP-UX. Are there any side-effects of defunct process? Can a parent process get killed because there are lot of defunct processes? say 50 defunct childs?? -Ashish (1 Reply)
Discussion started by: shriashishpatil
1 Replies

9. Programming

defunct process!!

how can i assure that daemon process which is being run as init child,can be removed immediately from system when it goes defunct or to avoid daemon process becoming defunt? (5 Replies)
Discussion started by: rish2005
5 Replies

10. UNIX for Dummies Questions & Answers

<DEFUNCT> Processes

When I ps -ef I see about 3 or 4 <DEFUNCT> things - what are these, and what causes them? Are they a concern? How can I fix them? Thanks, Michael (4 Replies)
Discussion started by: cuppjr
4 Replies
Login or Register to Ask a Question