01-09-2003
kill parent and child
Hello all,
I have gone through the search and looked at posting about idle users and killing processes. Here is my question I would like to kill an idle user ( which I can do) but how can I asure that all of his process is also killed whit out tracing his inital start PID. I have tried this on a solaris 8 system but, I seem to make the child process a zombie or hang because of what he was doing. Is there a clean way to do this?
Thanks
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. Filesystems, Disks and Memory
:(
Since I'm fairly new to the scene and don't have much experience in shell programming, I decided to check out the net for a useful script or two.
What I'm looking for is a script that would let me enter a PID and then show the process tree associated with it.
So it would display the (grand-)... (2 Replies)
Discussion started by: velde046
2 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. UNIX for Advanced & Expert Users
Hi all,
I am writing a script which calls other third party scripts that perform numerous actions. I have no control over these scripts.
My problem is, one of these scripts seems to execute and do what it is meant to do, but my calling / parent script always exits at that point. I need to... (4 Replies)
Discussion started by: mark007
4 Replies
5. UNIX for Dummies Questions & Answers
Consider this simple command line
bash -c 'echo $$ ; sleep 10000'This will print the newly created bash PID and sleep for a long time.
If I go to another terminal and do something like
ps -flax | grep leepI'll see something like
501 92418 91910 0 0:00.00 ttys000 0:00.00 bash -c echo $$... (5 Replies)
Discussion started by: teras
5 Replies
6. Programming
i used function fork().
so i made two process.
parent process accepted socket fd and writing to shared memory.
then now. how can child process share parent's socket fd?
is this possible?
Thanks in advance (1 Reply)
Discussion started by: andrew.paul
1 Replies
7. Homework & Coursework Questions
1. The problem statement, all variables and given/known data:
I need to make an program that in a loop creates one parent and five children with fork(). The problem i'm trying to solve is how to delete the parent and child of the childīs process.
2. Relevant commands, code, scripts,... (0 Replies)
Discussion started by: WhiteFace
0 Replies
8. 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
9. Shell Programming and Scripting
I am trying to kill PIDs that are tied to a KSH "load_sqlplus" and I am using the below code
LIST_PID=`ps -ef | grep -i "load_sqlplus" | grep -v grep | awk '{print $2}'`
if ; then
echo "Processes killed" "PID : " $LIST_PID
kill -9 $LIST_PID
else
echo "Nothing to Kill"
fi... (4 Replies)
Discussion started by: venky338
4 Replies
10. Shell Programming and Scripting
HI i would like to know how i can simulate a shell scripts for my requirement.
example
Server name child Process id Parent Process id
Vpesh 16013 15637
Server name child Process id Parent Process id
Vpesh 16014 15637
Server name child... (1 Reply)
Discussion started by: vpesh
1 Replies
LEARN ABOUT REDHAT
killall
KILLALL(1) User Commands KILLALL(1)
NAME
killall - kill processes by name
SYNOPSIS
killall [-e,--exact] [-g,--process-group] [-i,--interactive] [-q,--quiet] [-v,--verbose] [-w,--wait] [-V,--version] [-S,--sid] [-c,--con-
text] [-s,--signal signal] [--] name ...
killall -l
killall -V,--version
DESCRIPTION
killall sends a signal to all processes running any of the specified commands. If no signal name is specified, SIGTERM is sent.
Signals can be specified either by name (e.g. -HUP) or by number (e.g. -1).
If the command name contains a slash (/), processes executing that particular file will be selected for killing, independent of their name.
killall returns a zero return code if at least one process has been killed for each ilisted command. killall returns zero otherwise.
A killall process never kills itself (but may kill other killall processes).
OPTIONS
-e, --exact
Require an exact match for very long names. If a command name is longer than 15 characters, the full name may be unavailable (i.e.
it is swapped out). In this case, killall will kill everything that matches within the first 15 characters. With -e, such entries
are skipped. killall prints a message for each skipped entry if -v is specified in addition to -e,
-g, --process-group
Kill the process group to which the process belongs. The kill signal is only sent once per group, even if multiple processes belong-
ing to the same process group were found.
-i, --interactive
Interactively ask for confirmation before killing.
-l, --list
List all known signal names.
-q, --quiet
Do not complain if no processes were killed.
-v, --verbose
Report if the signal was successfully sent.
-V, --version
Display version information.
-w, --wait
Wait for all killed processes to die. killall checks once per second if any of the killed processes still exist and only returns if
none are left. Note that killall may wait forever if the signal was ignored, had no effect, or if the process stays in zombie
state.
-S (Flask only) Specify SID: kill only processes with given SID. Mutually exclusive with -c argument. Must precede other arguments on
command line.
-c (Flask only) Specify security context: kill only processes with given security context. Mutually exclusive with -s. Must precede
other arguments on the command line.
FILES
/proc location of the proc file system
KNOWN BUGS
Killing by file only works for executables that are kept open during execution, i.e. impure executables can't be killed this way.
Be warned that typing killall name may not have the desired effect on non-Linux systems, especially when done by a privileged user.
killall -w doesn't detect if a process disappears and is replaced by a new process with the same PID between scans.
AUTHORS
Werner Almesberger <Werner.Almesberger@epfl.ch> wrote the original version of psmisc. Since version 20 Craig Small <csmall@small.drop-
bear.id.au> can be blamed.
SEE ALSO
kill(1), fuser(1), pgrep(1), pidof(1), ps(1), kill(2)
Linux March 25, 2001 KILLALL(1)