06-02-2016
Get all child processes of a process
is there a universal way of getting the children of a particular process? i'm looking for a solution that works across different OSes...linux, aix, sunos, hpux.
i did a search online and i kept finding answers that were specific to Linux..i.e. pstree.
i want to be able to specify a process ID and then have the command spit out all its children processes. is this possible?
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I don't follow what these are...
this is what my text says...
"When a process is started, a duplicate of that process is created. This new process is called the child and the process that created it is called the parent. The child process then replaces the copy for the code the parent... (1 Reply)
Discussion started by: xyyz
1 Replies
2. Programming
Hello all, I am trying to create n child processes and control them from a parent process; say make child 3 print its pid and then child 5 do the same and some other stuff. Is there a way to accomplishing this after all the child processes are created via a call to fork().
Thank you,
FG (23 Replies)
Discussion started by: forumGuy
23 Replies
3. Shell Programming and Scripting
Hello.
I have a global function name func1() that I am sourcing in from script A. I call the function from script B. Is there a way to find out which script called func1() dynamically so that the func1() can report it in the event there are errors?
Thanks (2 Replies)
Discussion started by: yoi2hot4ya
2 Replies
4. Programming
Hello,
How many child processes are actually created when running this code ?
#include <signal.h>
#include <stdio.h>
int main () {
int i ;
setpgrp () ;
for (i = 0; i < 10; i++) {
if (fork () == 0) {
if ( i & 1 ) setpgrp () ;
printf ("Child id: %2d, group: %2d\n", getpid(),... (0 Replies)
Discussion started by: green_dot
0 Replies
5. Shell Programming and Scripting
Hello,
How many child processes are actually created when running this code ?
#include <signal.h>
#include <stdio.h>
int main () {
int i ;
setpgrp () ;
for (i = 0; i < 10; i++) {
if (fork () == 0) {
if ( i & 1 ) setpgrp () ;
printf ("Child id: %2d, group: %2d\n",... (1 Reply)
Discussion started by: green_dot
1 Replies
6. UNIX for Advanced & Expert Users
Hi,
Is there a way I can kill all the child processes of a process, given its process id.
Many thanks in advance.
J. (1 Reply)
Discussion started by: superuser84
1 Replies
7. UNIX for Advanced & Expert Users
Hi
I am trying to see if there are some options in ps command or if there is a shell script which basically shows you all the processes spawned by a parent process , then all the processes of its child processes and so on down the hierarchy may be like a tree structure. It might be a generic... (6 Replies)
Discussion started by: clifford
6 Replies
8. Shell Programming and Scripting
I have a parent process which will start 36 child process. This I achieved by using the 'for loop'.
In Parent.sh:-
./Child.sh <arg1> <arg2> ... &
If I execute "ps -ef | grep Child.sh", I can see 72 child processes running at the background. I mean I can see the duplicate of each process.
... (2 Replies)
Discussion started by: nthiruvenkatam
2 Replies
9. Shell Programming and Scripting
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
10. Shell Programming and Scripting
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
LEARN ABOUT DEBIAN
qpsmtpd-prefork
qpsmtpd-prefork(8) System Manager's Manual qpsmtpd-prefork(8)
NAME
qpsmtpd-prefork - Preforkin server for qpsmtpd
SYNOPSIS
qpsmtpd-prefork [options]
DESCRIPTION
qpsmtpd-prefork is the qpsmtpd frontend script which binds to the SMTP TCP socket, and asynchronously forks new children in advance of new
connections.
OPTIONS
--port port
Binds to a specific port, instead of the default 2525.
--user user
On startup, switch to run as user instead of the starting user. Applies only when started as root (as is normal when listening on
port 25).
--limit-connections limit
Accept at most limit simultaneous connections. Inbound connections beyondthis limit will be deferred or refused.
--max-from-ip limit
Accept at most limit simultaneous connections from any given IP address; does not override --limit-connections, if set.
--children limit
Limit the total number of child processes to limit; once all children are handling requests, further connections are deferred.
--idle-children count
Keep count child processes available, subject to the upper bound given via --children. Specify 0 to disable preforking entirely.
--interface addr
Bind to the local address addr, instead of the default behavior of binding to all interfaces. Can be specified multiple times to
bind to more than one interface or local address.
--renice-parent delta
Adjust the priority of the parent process by delta, yielding more CPU time to other processes. The default is 5.
--detach
Detach from the controlling terminal at startup, to run as a standalone daemon. See also --pid-file.
--pid-file filename
Upon startup, and after daemonizing if applicable, write the process ID to filename, for use by sysvinit control scripts or similar
utilities.
--pretty-child
Update child process names within the process table.
--version
Print the qpsmtpd release version and exit.
--debug
Be somewhat more verbose about logging during startup (has no effect once fully started).
--help Display commandline help and exit.
AUTHOR
Copyright (c) 2006, SoftScan; based on qpsmtpd-forkserver by Ask Bjorn Hansen <ask@develooper.com>
http://smtpd.develooper.com/
qpsmtpd-prefork(8)