02-02-2004
perderabo
actually i jus figured it out! thanks to you. you were a great help!
Cheers
a25khan
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Is there any build in command in unix to kill all the child process for a given process ID ? If any one has script or command, please let me know.
Thanks
Sanjay (4 Replies)
Discussion started by: sanjay92
4 Replies
2. Programming
Hi,
Can anybody solve this query?
A parent process forks 2 child processes. How does the child process know it's PID without the parent process sending it.
Apart from the "ps-ef" option, what other options are there if any? (2 Replies)
Discussion started by: skannan
2 Replies
3. UNIX for Advanced & Expert Users
Hi all,
Please look into the following code :
int main()
{
char command;
int pid, ppid;
ppid = getpid(); /* Get the parent pid */
pid = fork(); /* Fork */
if ( pid ==0 )
{
sprintf( command, " gdb a.out %d ", ppid );
printf( "Command line is %s\n", command );
system( command... (3 Replies)
Discussion started by: asvija
3 Replies
4. Shell Programming and Scripting
This is not the same as a few of the other posted items dealing with sub-process pids (that I saw anyway).
If zot contains:
echo "main mypid: $$ - lastpid: $!"
(
echo "block mypid: $$ - lastpid: $! - ppid: $PPID"
ps -ef > xxx
sleep 5
echo "block mypid: $$ - lastpid: $! - ppid:... (6 Replies)
Discussion started by: MichLab
6 Replies
5. Shell Programming and Scripting
I am using ZSH shell in Linux.
I am calling a child program in background mode parallely (say 2-3 threads). I have problem in handling the temporary files of these child programs since the temp file names are unique for all the child process.
To distinguish i want to use the pid in the temp... (3 Replies)
Discussion started by: dhams
3 Replies
6. UNIX for Dummies Questions & Answers
All,
I've got a script that needs to check if it was started by cron. The code seems to be right, but it's not running correctly if cron starts it. Am I getting the pid's correctly? I'm not having any luck figuring it out. :confused: Any help is appreciated!
CRON_ID=$(ps -aef | grep... (1 Reply)
Discussion started by: GregWold
1 Replies
7. Shell Programming and Scripting
Hi,
I'm looking for a method where we can capture the PID and if possible the progress of child process especially the ones running in background.
can anyone help? (6 Replies)
Discussion started by: aman jain
6 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I need some help understanding PID and PPID that is shown by the ps -ef output. OS is Solaris 5.8. :wall:
There are several Oracle databases and processes running on this server and they all have the same PPID. Does that mean they are all spawned off the same startup script?
I then... (1 Reply)
Discussion started by: newbie_01
1 Replies
9. Red Hat
Hi ,
My problem is that I am not able to list all process id of any process.
If you see pstree command it shows many process id under https. But if I run ps command its not listing all the process id for httpd.
It is just listing the PPID and immediate child process id only. I... (4 Replies)
Discussion started by: pratapsingh
4 Replies
10. Shell Programming and Scripting
HI
Am trying to get child process id for a PID using ksh..
ps -ef | grep xntpd
root 3342472 2228308 0 12:17:40 - 0:00 /usr/sbin/xntpd
root 4522024 6488316 0 12:18:56 pts/0 0:00 grep xntpd
root 6291614 3342472 0 12:17:40 - 0:00 /usr/sbin/xntpd
Here now i... (1 Reply)
Discussion started by: Priya Amaresh
1 Replies
setpgid(2) System Calls Manual setpgid(2)
NAME
setpgid(), setpgrp2() - set process group ID for job control
SYNOPSIS
DESCRIPTION
The and system calls cause the process specified by pid to join an existing process group or create a new process group within the session
of the calling process. The process group ID of the process whose process ID is pid is set to pgid. If pid is zero, the process ID of the
calling process is used. If pgid is zero, the process ID of the indicated process is used. The process group ID of a session leader does
not change.
is provided for backward compatibility only.
Security Restrictions
Some or all of the actions associated with this system call are subject to compartmental restrictions.
See compartments(5) for more information about compartmentalization on systems that support that feature. Compartmental restrictions can
be overridden if the process possesses the privilege (COMMALLOWED). Processes owned by the superuser may not have this privilege. Pro-
cesses owned by any user may have this privilege, depending on system configuration.
See privileges(5) for more information about privileged access on systems that support fine-grained privileges.
RETURN VALUE
and return the following values:
Successful completion.
Failure.
is set to indicate the error.
ERRORS
If or fails, is set to one of the following values.
The value of pid matches the process ID of a child process of the calling process and the child process has successfully executed
one of the exec(2) functions.
The value of pgid is less than zero or is outside the range of valid process group ID values.
The process indicated by
pid is a session leader.
The value of pid is valid but matches the process ID of a child process of the calling process, and the child process is not in
the same session as the calling process.
The value of pgid does not match the process ID of the process indicated by pid and there is no process with a process group ID
that matches the value of pgid in the same session as the calling process.
The value of pid does not match the process ID of the calling process or of a child process of the calling process.
AUTHOR
and were developed by HP and the University of California, Berkeley.
SEE ALSO
bsdproc(3C), exec(2), exit(2), fork(2), getpid(2), kill(2), setsid(2), signal(2), privileges(5), termio(7).
STANDARDS CONFORMANCE
setpgid(2)