Find the Pid and Kill the Process after a Few Minutes
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
and my cron to execute every minute every hour every day
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)
I need to write a shell script which would take 2 arguments pid , userid. Then it should kill all the child process under it. If a child process is not killed then it should wait for 1 minute and should kill.
can anybody give me the idea to write it? (0 Replies)
#!/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)
Hi Friends,
How can we find the process ID of a running process using the process name. In AIX I used to use the command "ps -ef | grep <process name>", it used to give me the owner of that process, Process ID and the threads running and the name of the process in the end.
However in... (2 Replies)
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)
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)
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)
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)
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
LEARN ABOUT REDHAT
kill
KILL(1) Linux Programmer's Manual KILL(1)NAME
kill - terminate a process
SYNOPSIS
kill [ -s signal | -p ] [ -a ] [ -- ] pid ...
kill -l [ signal ]
DESCRIPTION
The command kill sends the specified signal to the specified process or process group. If no signal is specified, the TERM signal is sent.
The TERM signal will kill processes which do not catch this signal. For other processes, it may be necessary to use the KILL (9) signal,
since this signal cannot be caught.
Most modern shells have a builtin kill function, with a usage rather similar to that of the command described here. The `-a' and `-p'
options, and the possibility to specify pids by command name is a local extension.
OPTIONS
pid... Specify the list of processes that kill should signal. Each pid can be one of five things:
n where n is larger than 0. The process with pid n will be signaled.
0 All processes in the current process group are signaled.
-1 All processes with pid larger than 1 will be signaled.
-n where n is larger than 1. All processes in process group n are signaled. When an argument of the form `-n' is given, and it
is meant to denote a process group, either the signal must be specified first, or the argument must be preceded by a `--'
option, otherwise it will be taken as the signal to send.
commandname
All processes invoked using that name will be signaled.
-s signal
Specify the signal to send. The signal may be given as a signal name or number.
-l Print a list of signal names. These are found in /usr/include/linux/signal.h
-a Do not restrict the commandname-to-pid conversion to processes with the same uid as the present process.
-p Specify that kill should only print the process id (pid) of the named processes, and not send any signals.
SEE ALSO bash(1), tcsh(1), kill(2), sigvec(2), signal(7)AUTHOR
Taken from BSD 4.4. The ability to translate process names to process ids was added by Salvatore Valente <svalente@mit.edu>.
Linux Utilities 14 October 1994 KILL(1)