10-16-2002
You may want to write your own script - I'm trying to stay objective, but that script is flawed.
First off, those echo statements are being redirected to /dev/null. What's the point?
And it uses kill -9 right away, which is a Bad Thing if your users have anything running or any processes backgrounded. Also, I've seen problems with killing off a user very harshly like that that can mess up their entries in w or who, saying they exist even though they don't. You'll also end up with orphaned processes that way...
One alternative that I've seen is idled:
http://www.darkwing.com/idled/
It's a little cleaner than crashing around in the dark "kill -9"'ing processes automatically.
8 More Discussions You Might Find Interesting
1. Solaris
Hi, anyone
Audit requirement to set the Solaris 8 server session timeout to 180 sec
, Please advice how can I do it ....
Thanks (3 Replies)
Discussion started by: civic2005
3 Replies
2. Shell Programming and Scripting
I am executing test.sh script. But this script takes lot of time and in the meantime the shell timeouts without completing the script.
Is there any command which will continue processing the script.
Thanks (3 Replies)
Discussion started by: infyanurag
3 Replies
3. HP-UX
Our network administrators implemented some sort of check to kill idle sessions and now burden is on us to run some sort of keep alive. Client based keep alive doesn't do a very good job. I have same issue with ssh. Does solution 2 provided above apply for ssh sessions also? (1 Reply)
Discussion started by: yoda9691
1 Replies
4. AIX
We recently moved servers to a new data center, and now we're experiencing user sessions timing out after non-activity. We didnt experience this before, or know of any timeout settings that may have been changed.
Any things I can check out on the server? (3 Replies)
Discussion started by: NycUnxer
3 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I had add the following line into .profile and .bash_profile for the timeout session to avoid putty close automatically :
timeout=10800
However, i still keep encounter session time out every after 60 seconds.
Can anyone please help advice.
Many Thanks! (2 Replies)
Discussion started by: wancy
2 Replies
6. Solaris
Hi All
I need to set timeout of login session of a user if a user is idle for some time.
I know the TMOUT setting but it work with only BASH & KORN shell only as I need to set for Bourne shell also. I am trying to put "ClientAliveInterval 300" in sshd_config & restart or refreshing the... (1 Reply)
Discussion started by: sb200
1 Replies
7. AIX
Friends,
Could anyone let me know - how to set the timeout value for ssh session to HMC? My HMC version is -- V7R7.4.0. I'm sure the version doesn't have anything to do with it.
Thanks,
-- Souvik (2 Replies)
Discussion started by: thisissouvik
2 Replies
8. Linux
Hello friends,
I work on Linux servers via SSH (putty) and run "screen" to preserve my sessions so I can attach/detach them at anytime I wish without losing the connectivity/process disruption which is working perfectly fine.
As my team members also have root access to those servers, it is... (7 Replies)
Discussion started by: prvnrk
7 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)