Re: Kill app

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, Dec 26, 2002 at 08:16:09PM -0800, anthony baldwin wrote:
> I have run "man kill" and it is not in any decipherable language resembling
> english.

Sure it is... you just need to know a little about Unix signals and
processes.  A pid as a Process ID.  You can find out the pid of
running processes using the ps command.  For example, the following
command will show you information about all processes you are
currently running:

  $ ps ux
  USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
  ddm      26736  0.1  1.3  7716 2660 pts/2    S    23:25   0:00 vim +set textwidt
  ddm      26768  0.0  0.3  2680  764 pts/0    R    23:28   0:00 ps ux
  [output much abbreviated]


The pid is the number in the second column of the output.  So, say you
wanted to get rid of that vim process, because it's not responding.
Usually, this should suffice:

  $ kill 26736

Without specifying a signal, by default kill uses the TERM signal.
This signal tells the process which receives it to terminate.  It
normally allows the process to clean up after itself, to make sure no
work is lost, for example.  Of course, if the program is broken, it
may not respond to the signal.  Sometimes, more stubborn processes
require a heavy hand.  For these, you can use the KILL signal.  This
unconditionally terminates a running process.  [Actually, there are
exceptions to this, but they're not really important for this
discussion.]  So the example above would be re-written thusly:

  $ kill -KILL 26736

The signals also have numbers, and you could use them instead.  The
last command could be more concisely written:

  $ kill -9 26736

Much of this is documented in the manuals that come with Red Hat.  You
might want to have a look at those, or at a book like O'Reilly's
_Running Linux_.  The meanings of the rest of the columns in the
output of ps are documented in the man page for the ps command.

> I have, from time to time, had apps hang and not respond and the
> only recourse I have found is to log out.  I know that is a weak way
> to handle the issue

Not only that, but it may not really work.  IOW, the process may be
left hanging around, if it's really stuck.  You won't see it running,
but it might still there...  It will show up in the output of the ps
command.

> computer for two years, but the documentation and man pages are
> often completely useless because they assume way too much in user
> knowledge.  

I understand where you're coming from, but if they didn't make such
assumptions, the man pages would occupy gigabytes of space...  A good
book on running Linux, or the RH manuals for that matter, will teach
you just about everything you'll ever need to know for day-to-day use
of a Linux system.  For the rest, there's lists like this one.  :)

- -- 
Derek D. Martin
http://www.pizzashack.org/
GPG Key ID: 0xDFBEAD02

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+C9oIHEnASN++rQIRAplaAJ0a7nw7ZJxUPjVRbbRrTJBSW4BgDgCgw06J
wdwxSEd72Jhod0NAdZ+DCkg=
=iCB5
-----END PGP SIGNATURE-----



-- 
Psyche-list mailing list
Psyche-list@redhat.com
https://listman.redhat.com/mailman/listinfo/psyche-list

[Index of Archives]     [Fedora General Discussion]     [Red Hat General Discussion]     [Centos]     [Kernel]     [Red Hat Install]     [Red Hat Watch]     [Red Hat Development]     [Red Hat 9]     [Gimp]     [Yosemite News]

  Powered by Linux