Sponsored Content
Top Forums Programming Daemon...Zombie?? Please help me Post 71294 by Perderabo on Monday 9th of May 2005 09:18:53 PM
Old 05-09-2005
Please make sure that you have read our rules. And note:
(6) Do not post classroom or homework problems.

But we sometimes bend this rule when a student has done a lot of work. So I'll make a few comments based on a quick scan of your code. This line of code:
while(1) sleep(1);//run
is dangerous. Why do you have it? I would delete it. If you meant to do something like:
while (1) { List() ; sleep(1) ; }
then you have the fork() in the wrong place. You need to fork() once at the beginning of the program. At present, your program is running List() once and then falling into your infinite sleep loop. You have some re-writing to do.

wait(30);
is illegal and also dangerous. I don't even know what you want to happen there. The last thing you do in List is to ignore some signals. You should ignore signals earlier. If you put List() in a loop, you need to move the signal calls to near the beginning somewhere.

Your instructor probably told you to check if the parent pid is 1, but your instructor is wrong. That is not the definition of a daemon. As it happens, you can probably get away with test you have. But the definition of a daemon is a program with no controlling terminal. You could check that by attempting to open /dev/tty. A daemon must fail but a non-damon must succeed.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

zombie program

When you run a ps -ef and if the status is a Z (zombie) does that mean the same as not responding? (Like a windows machine). Also has anyone here heard of the program called 'top' (I've found it on our Solaris 7 machines) If you have you might be able to help me. I need to know if there is a... (8 Replies)
Discussion started by: merlin
8 Replies

2. UNIX for Advanced & Expert Users

Zombie process

I would like to create a zombie process so that I can test monitoring software functionality. Any techniques? (2 Replies)
Discussion started by: swhitney
2 Replies

3. UNIX for Advanced & Expert Users

zombie daemon process!!

My daemon process is the child of init and init has the responsibility to remove it, once it turns zombie. But I want to ask why the daemon process which is child of init turns zombie in the first place. What measures I have to take to avoid this? rish (1 Reply)
Discussion started by: rish2005
1 Replies

4. Shell Programming and Scripting

Zombie process

Hi I need help because I don't know if it is possible to add a find inside a cat. like I have a file with the pid of the process that use to became zombie. And I have the same pid stored in the var (pid1) now, I have no clue how to check if the the find finds the pid or even if it's... (2 Replies)
Discussion started by: ruben.rodrigues
2 Replies

5. Solaris

zombie process

dear friends, in an interview they asked me what is zombie process. how we can identifying these process.if can you kill all zombie process. (8 Replies)
Discussion started by: sijocg
8 Replies

6. AIX

zombie process

Is there an equivilant to the preap command in AIX that would allow me to get rid of a zombie process. I am new to AIX, moving over from Solaris and in the past I have been able to preap the pid on the defunct process to clean them up. I have looked around and the best I can see is that it may... (3 Replies)
Discussion started by: sboots
3 Replies

7. UNIX for Dummies Questions & Answers

what is zombie , how to kill it ,

Hello I try to googled it , but I dint get sufficient answer :( .. When I can see zombie running on server do they consume system resources or not ? I have read that is not good to kill them with signal 9 cause it might cause more troubles .. why is kill -9 so harmfull? thanks (2 Replies)
Discussion started by: kvok
2 Replies

8. UNIX for Advanced & Expert Users

Zombie process

What is the overhead associated with zombie process?Is it running out of process-ID?:confused: Since some information is stored in process table.. Thanks in Advance (4 Replies)
Discussion started by: jois
4 Replies

9. Red Hat

zombie

Hi, Linux redhat 5.5 top shows that i have 20 zombie process : Tasks: 357 total, 1 running, 336 sleeping, 0 stopped, 20 zombie Cpu(s): 0.2%us, 0.3%sy, 0.0%ni, 99.5%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st Mem: 24949400k total, 2363052k used, 22586348k free, 227084k buffers... (1 Reply)
Discussion started by: yoavbe
1 Replies

10. Programming

Zombie in C

hello all, when we are creating a process by using fork, if the child process terminates before parent, the child process exists as zombie.. My doubt is when that child process terminates, how come that process exists further and show as a zombie process..can anyone help me to clear about this? (1 Reply)
Discussion started by: aarathy
1 Replies
evmreload(1M)															     evmreload(1M)

NAME
evmreload - reload Event Manager configuration files SYNOPSIS
DESCRIPTION
The command posts control events that instruct EVM resident components to reload their configuration files. Use the command to cause EVM to begin using the new configuration at any time that a configuration file has been changed. If no options are specified, the daemon, the channel manager, and the logger all reload their configurations. Reconfigure the daemon at any time that its configuration file or that an event template database has changed. Reconfigure the logger at any time that its configuration file has changed. Reconfigure the channel manager at any time that its configuration file has changed. Resident EVM components also reload their configuration files on receipt of a signal. If an activity monitor is specified in the EVM daemon configuration file, all counts and timers associated with the monitor are reset. Options Reconfigures the EVM channel manager. Reconfigures the EVM daemon. Reconfigures the EVM logger. Syntax checks the event template files and reports errors, but does not make any changes effective. If a daemon reconfiguration is requested, the reconfiguration request is sent even if there are errors in any template file. If errors exist in the template file, there is no guarantee that the new configuration is accepted. Notes The command uses the command to check for errors in configuration files before sending a reload request to EVM. If errors are found, they are reported to and no reconfiguration request is sent. This check does not find all possible errors, however, so be sure to check for errors reported by the EVM components themselves. To do this, run the following command: RETURN VALUES
The following exit values are returned: Successful completion. An error occurred. EXAMPLES
o The following command causes the EVM daemon to reconfigure itself. o The following command causes the EVM logger to reconfigure itself. o The following command causes the EVM channel manager to reconfigure itself. o The following command causes a syntax check of the daemon configuration file without any reconfiguration actually occurring. o The following command reconfigures both the EVM daemon and the EVM logger. o The following command reconfigures the EVM daemon, the EVM logger, and the EVM channel manager. o The following command reconfigures the EVM daemon, the EVM logger, and the EVM channel manager even if there are errors in the template file. WARNINGS
You must be to run this command. SEE ALSO
Commands evmpost(1), evmchmgr(1M), evmd(1M), evminfo(1), evmlogger(1M). Files evmchannel.conf(4), evmdaemon.conf(4), evmlogger.conf(4). Event Management EVM(5). EVM Events EvmEvent(5). evmreload(1M)
All times are GMT -4. The time now is 10:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy