10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All, Looking for a quick LINUX shell script which can continuously monitors the flle size, report the process which is creating a file greater than certain limit and also kill that process. Can someone please help me on this? (4 Replies)
Discussion started by: vasavimacherla
4 Replies
2. Shell Programming and Scripting
Hi there!
I have a tricky problem concerning a nohup process:
I started a python2.7 script which loops over a function.
At the end it restarts the function. Due to a mistake I'm now having a never ending nohup process that I have to kill.
I started the program execution with:
>>nohup... (4 Replies)
Discussion started by: Lydia
4 Replies
3. Shell Programming and Scripting
hi guys
i had written a shell script Display Information of all the File Systems
i want to find the pid and kill the process after few minutes.how can i obtain the pid and kill it???
sample.sh
df -a >> /tmp/size.log
and my cron to execute every minute every hour every day
* *... (5 Replies)
Discussion started by: azherkn3
5 Replies
4. Red Hat
Hi Expert,
I am not able to kill certain user process as root. I have tried using:
pkill -u uname
skill KILL -u uname
kill -9 PID
*** I have not using killall yet, since this server has more than 100 users online atm.
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND... (1 Reply)
Discussion started by: regmaster
1 Replies
5. Shell Programming and Scripting
Hello,
I have problem with killing red5 process running on linux server. As this process is continuously changing its PID so it can't be killed with "kill -9 PID" command.
First I used following command to list RED5 process
ps aux | grep red5
which showed me
root 5832 0.0 0.0 4820 756pts/0... (4 Replies)
Discussion started by: ninadgac
4 Replies
6. UNIX for Dummies Questions & Answers
Hello,
I have problem with killing red5 process running on linux server. As this process is continuously changing its PID so it can't be killed with "kill -9 PID" command.
First I used following command to list RED5 process
ps aux | grep red5
which showed me
root 5832 0.0 0.0 4820 756pts/0... (1 Reply)
Discussion started by: ninadgac
1 Replies
7. Shell Programming and Scripting
#!/bin/sh
who
echo "\r"
echo Enter the terminal ID of the user in use:
echo "\r"
read TERM_ID
echo "\r"
ps -t $TERM_ID | grep sh
echo "\r"
echo Enter the process number to end:
echo "\r"
read PID
echo "\r"
kill -9 $PID
What this code does is ultimately grab the PID of a users sh... (6 Replies)
Discussion started by: psytropic
6 Replies
8. Shell Programming and Scripting
Hi All,
In my project i have two process runs in the back end.
Once i start my project, and execute the command ps, i get below output:
PID TTY TIME CMD
9086 pts/1 0:00 ksh
9241 pts/1 0:02 java
9240 pts/1 0:00 shell_script_bg
java with 9241 PID is the main... (4 Replies)
Discussion started by: rkrgarlapati
4 Replies
9. Shell Programming and Scripting
Dear Unix Gurus,
Here is my query.
If i start a script,it inturn calls many other scripts ..and most of them continue to run in parallel.
Suppose,if i want to stop my script for some reason,i need to kill -9 each of the processes running.It becomes clumsy if the sub processes r more.
... (15 Replies)
Discussion started by: gvsreddy_539
15 Replies
10. 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
PCNTL_WAITPID(3) 1 PCNTL_WAITPID(3)
pcntl_waitpid - Waits on or returns the status of a forked child
SYNOPSIS
int pcntl_waitpid (int $pid, int &$status, [int $options])
DESCRIPTION
Suspends execution of the current process until a child as specified by the $pid argument has exited, or until a signal is delivered whose
action is to terminate the current process or to call a signal handling function.
If a child as requested by $pid has already exited by the time of the call (a so-called "zombie" process), the function returns immedi-
ately. Any system resources used by the child are freed. Please see your system's waitpid(2) man page for specific details as to how wait-
pid works on your system.
PARAMETERS
o $pid
- The value of $pid can be one of the following:
possible values for $pid
+-----+---------------------------------------------------+
| | |
|< -1 | |
| | |
| | wait for any child process whose process group |
| | ID is equal to the absolute value of $pid. |
| | |
| | |
| -1 | |
| | |
| | wait for any child process; this is the same be- |
| | haviour that the wait function exhibits. |
| | |
| | |
| 0 | |
| | |
| | wait for any child process whose process group |
| | ID is equal to that of the calling process. |
| | |
| | |
|> 0 | |
| | |
| | wait for the child whose process ID is equal to |
| | the value of $pid. |
| | |
+-----+---------------------------------------------------+
Note
Specifying -1 as the $pid is equivalent to the functionality pcntl_wait(3) provides (minus $options).
o $status
-pcntl_waitpid(3) will store status information in the $status parameter which can be evaluated using the following functions:
pcntl_wifexited(3), pcntl_wifstopped(3), pcntl_wifsignaled(3), pcntl_wexitstatus(3), pcntl_wtermsig(3) and pcntl_wstopsig(3).
o $options
- The value of $options is the value of zero or more of the following two global constants OR'ed together:
possible values for $options
+----------+---------------------------------------------------+
| | |
| WNOHANG | |
| | |
| | return immediately if no child has exited. |
| | |
| | |
|WUNTRACED | |
| | |
| | return for children which are stopped, and whose |
| | status has not been reported. |
| | |
+----------+---------------------------------------------------+
RETURN VALUES
pcntl_waitpid(3) returns the process ID of the child which exited, -1 on error or zero if WNOHANG was used and no child was available
SEE ALSO
pcntl_fork(3), pcntl_signal(3), pcntl_wifexited(3), pcntl_wifstopped(3), pcntl_wifsignaled(3), pcntl_wexitstatus(3), pcntl_wtermsig(3),
pcntl_wstopsig(3).
PHP Documentation Group PCNTL_WAITPID(3)