about child process


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers about child process
# 8  
Old 03-21-2006
Computer about parent of processes INIT

as the kernal invokes a process INIT during the time of booting which in turn spawns all other processes because of which it is considered as parent process.

does it too calls system call fork() or there is something like this?

init() process2()

{
{ process3()
process2;
} } and so onnnnnnnnnnnnnn.


please dont mind if you think it a stupid question.because i am a student learning UNIX i want to know the UBDERLYING CONCEPTS and NOT JUST COMMANDS.


THANKS amor1
# 9  
Old 03-21-2006
here's

You welcome, and there're no stupid questions, we learn sofisticated system with some 30+ years of development...

Generally as far as I learned there are only two ways for making unix process and here they are:
1. The special processes: these are processes that are created under system boot time and they are created by some programing tricks and special methods, it is not UNIX yet, it is a midway. Depending of version of unix it is may be just init process or there are may be two-three with some memory-disk swapping "abnormal" deamon that system will not let you kill.

2. The normal processes: as we desribed above, and ALL the processes use the same scheme. It allows in a turn to command processes in a similar way, by sending signals to them (you always can get a list of signals available for your system with "kill -l" command). It also implyes the so called "standard process lifespan".

Generally speaking, yes all processes including init use the same scheme for replicating, by the end of their lifespan, process passes so called "zombi" phase and thankfully to the scheme, init takes care to remove the proceses that had not been removed properly by their own parent processes (in a case when parent process was terminated before child process).
Hope it helps.
# 10  
Old 03-22-2006
Question is it possible to DECIDE which commands create child process

thanks for your encouragement amro1.


as you told earlier a commnand kicks of other process which does the job on its behalf.

do all commands CREATE child process?
if not how can i say EXACTLY which one CREATES A CHILD and WHICH DOES NOT

is there any criteria to decide upon?
# 11  
Old 03-22-2006
Quote:
do all commands CREATE child process?
Why should it create and what is the need for that?
Did you mean command or system call ?

Quote:
if not how can i say EXACTLY which one CREATES A CHILD and WHICH DOES NOT
One go would be,
processing service requests where parent would handle incoming requests alone, forks and handover the processing job to the child and parent would block on listen-for active requests.
# 12  
Old 03-22-2006
i mean COMMANDS

let us say ,we have two commands

cat file1, vi file2

is it possible to judge which of these two commands will kick off a child process?

if it is possible in any means like through programming or any other means to say EXACTLY which commands create child process which does not let me know.

this is what exactly i wanna knkow

thanks
# 13  
Old 03-22-2006
here...

you can judge on the basis of functionality , and if you need to know for sure, for each systems there is process descriptor in /proc. Look into system specific manual to interpret the data in /proc.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

forking a child process and kill its parent to show that child process has init() as its parent

Hi everyone i am very new to linux , working on bash shell. I am trying to solve the given problem 1. Create a process and then create children using fork 2. Check the Status of the application for successful running. 3. Kill all the process(threads) except parent and first child... (2 Replies)
Discussion started by: vizz_k
2 Replies

2. Emergency UNIX and Linux Support

signal between parent process and child process

Hello, everyone. Here's a program: pid_t pid = fork(); if (0 == pid) // child process { execvp ...; } I send a signal (such as SIGINT) to the parent process, the child process receive the signal as well as the parent process. However I don't want to child process to receive the... (7 Replies)
Discussion started by: jackliang
7 Replies

3. Shell Programming and Scripting

script to get child process for a process

!/bin/sh pid=$(ps -Aj | grep MSTRSvr | grep -v grep | awk '{print $1}') sid=$(ps -Aj | grep MSTRSvr | grep -v grep | awk '{print $3}') ps -s "$sid" I am not able to get the desired output it says process list error if i use watch ps -s "$sid" it considers only the first session id (5 Replies)
Discussion started by: schippada
5 Replies

4. Shell Programming and Scripting

[KSH/Bash] Starting a parent process from a child process?

Hey all, I need to launch a script from within 2 other scripts that can run independently of the two parent scripts... Im having a hard time doing this, if anyone knows how please let me know. More detail. ScriptA (bash), ScriptB (ksh), ScriptC (bash) ScriptA, launches ScriptB ScirptB,... (7 Replies)
Discussion started by: trey85stang
7 Replies

5. Shell Programming and Scripting

Child Process Name

Hi , I want to find out the child process name given its PID. I have used the ps command but it displays the parent process name against child PID. Is there any way to find out name of child program executing under any parent program? (1 Reply)
Discussion started by: sneha_heda
1 Replies

6. Shell Programming and Scripting

How to make the parent process to wait for the child process

Hi All, I have two ksh script. 1st script calls the 2nd script and the second script calls an 'C' program. I want 1st script to wait until the 'C' program completes. I cant able to get the process id for the 'C' program (child process) to make the 1st script to wait for the second... (7 Replies)
Discussion started by: sennidurai
7 Replies

7. Programming

Why does my child process not exit?

Im sure it has something to do with the wait() call, but everything ive tried either leaves me with a zombie or with the exec executing indefinitely. switch(pid = fork()) { case -1:perror("fork failed"); exit(1); case 0: if(key == "cd") { execl("/bin/cd", "cd",... (2 Replies)
Discussion started by: p00ndawg
2 Replies

8. UNIX for Dummies Questions & Answers

doubt in child process

fork() system is used to create a child a process.lets consider fork() echo krace will print krace twice .if i give it in loop it will print krace 2 power n time..in this case all child and parent process executes same process ...but i want to create a four different child process to execute four... (4 Replies)
Discussion started by: kracekumar
4 Replies

9. Programming

creating child process

i want to create 3 child processes from the same parent using folk. I know how to use folk but my child processes did not come from the same parent. Any suggestion what i did wrong ? (12 Replies)
Discussion started by: Confuse
12 Replies

10. UNIX for Dummies Questions & Answers

KDM child process

Hello all, I got this little problem. I don't know what happen, but its not stopping work but is more of an FYI. I have this funny process running when I do ps -aef (on RedHat AS3 ) server I get this funny child process. root 2345 1 .... /usr/bin/kdm -nodaemon root... (6 Replies)
Discussion started by: larryase
6 Replies
Login or Register to Ask a Question