Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Meaning and typical use of -3 signal in kill Post 302446802 by methyl on Thursday 19th of August 2010 07:02:13 PM
Old 08-19-2010
Okay here we go. The long explanation. Other correspondants may wish to add more.

When you issue "kill -n" the value of "n" is a numeric representation of the "signal". The list of signal numbers and their meaning for your Operating System is always available ... but we don't know which O/S you have.


The "quit" control code (in you case ctrl \) can be typed at a keyboard to deliberately crash a foreground process which is running on your terminal at that time and then produce a core dump. This is why many administrators disable this control code in user sessions. Unless you are in a development environment the core dump is of no value.
When typed at a keyboard the "quit" control code has no effect whatsoever on background processes.

The "kill -3 <pid>" unix command sends the signal to the background process with Process Identity <pid> (or for that matter to a process running in foreground on a terminal other than your own) asking that process to stop immediately and dump core. Unless you are in a development environment the core dump has no value.
Be aware that a process can be written to ignore any signal (except signal 9).

Though stating the obvious you cannot issue a "kill" command on your own terminal to your own foreground process because you do not have a command prompt at the time.

Most administrators would actually issue "kill -15" (hangup) to a broken background process unless of course the process is a database application which requires a specific different signal. The hangup signal simulates pulling out the cable on a serial terminal and most well-written applications will close tidily.

Most administrators (and users) would issue ctrl/C (interrupt) to a foreground process to ask it to stop. Administrators often disable this key at unix level where it needed by the application or when they don't want users crashing applications and being presented with a unix command prompt.
The ctrl/C keystroke has a similar function in Microsoft MSDOS and just happened to like unix and CP/M when MSDOS first came out.

The unix shell "trap" command can be used to intercept signals (excluding signal 9) and this can be useful for invoking a cleanup procedure.


Beware: There is rarely ever a reason to issue "kill -9" to a process and it should never ever be issued to a database server or client unless perhaps you are already in dire straits and cannot shut a server down just prior to restoring your backup.
You will find in you research that some critical unix processes (like "inetd") respond to specific signals and restart themselves cleanly after re-reading parameter files. This convenience is rarely found in commercial applications.


Footnote: Some unix kernels have a very limited default maximum process number and can recycle Process IDs rather too quickly. It may be that this is what is happening to you? A commercial unix will need a kernel build to match the expected load and this will usually cause a substantial increase in the maximum value of a Process ID and therefore less frequent recycling of Process IDs.

Last edited by methyl; 08-19-2010 at 08:13 PM.. Reason: typos,spellin
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

kill signal

Hello e'bdy, We have WebSphere MQ running on AIX 5.1 Every weekend MQ receives a kill -30 signal from some process or user and offloads a big error file. There is no way in MQ through which that process can be tracked. Is there something which i can do on UNIX level to trap the process? Best... (3 Replies)
Discussion started by: jhaavinash
3 Replies

2. UNIX for Advanced & Expert Users

Kill Signal

Hello, I'm doing a project of OS simulation (Process Scheduling, to be very specific). Can anyone, please, explain what exactly happens in the background when we see "Sending all processes the KILL signal...........". How is it sent to each process? Is it that something like a boolean is stored... (3 Replies)
Discussion started by: ameya
3 Replies

3. Solaris

Typical way to disable a dameon

I want to disable some services starting automatically while system booting, for instance if i want to disable vold what i have to do ? i think some services related to a script init level shell directory,and i think as well that since solaris 10 they added a command to enable and disable services... (2 Replies)
Discussion started by: XP_2600
2 Replies

4. Shell Programming and Scripting

typical mail script

hi i have a requirement to write a mail script which needs to be automated.There are 7 CSV files generated for 7 clients in a single day.Each file will contain one header and the name of the file follows a nomenclature like ABC_20080402_ClientID.csv.ClientID is lets say... (3 Replies)
Discussion started by: dr46014
3 Replies

5. Shell Programming and Scripting

How to Trap kill -9 signal

I just want to trap kill -9 signal issued by any of user from any terminal and just capture that user terminal who had raised this kill -9 command (1 Reply)
Discussion started by: puneet.goel
1 Replies

6. Shell Programming and Scripting

A typical array script

Hi All, I need to store the output of "find ." to an array one by one. Output of find . in my case will look like :- . ./one ./one/a ./one/b ./one/c ./two So my first array element should be "/one" and second one "/one/a" (need to remove "." from the output as well). Then I need to... (11 Replies)
Discussion started by: Renjesh
11 Replies

7. Emergency UNIX and Linux Support

Calculating total space in GB for all files with typical pattern

Hi Experts, In a particular dir, I have many files *AJAY*. How can I get total size of all such files. I tried du -hs *AJAY* but it gave me individual size of all files. All I require is summation of all. Thanks, Ajay (4 Replies)
Discussion started by: ajaypatil_am
4 Replies

8. Shell Programming and Scripting

Typical problem in UNIX

Input file I have a file with four fields. f1,f2,f3,f4 A,1,10,00,S B,2,20,00,00,D C,3,100,00,00,G I want Output like f1|f2|f3|f4 A|1|10,00|S B|2|20,00,00|D C|3|100,00,00|G please help on this (4 Replies)
Discussion started by: bharat1211
4 Replies

9. UNIX for Dummies Questions & Answers

How to compile a software for a non-typical platform?

I am quite new to compiling source codes in linux and have been running into a lot of problems in trying to do so since the platform configuration is different from most. For starters, I know that you need to enter the following commands in order to install any software manually in linux:... (2 Replies)
Discussion started by: Ice_Drake1
2 Replies
term::ansi::ctrl::unix(n)					 Terminal control					 term::ansi::ctrl::unix(n)

__________________________________________________________________________________________________________________________________________________

NAME
term::ansi::ctrl::unix - Control operations and queries SYNOPSIS
package require Tcl 8.4 package require term::ansi::ctrl::unix ?0.1? ::term::ansi::ctrl::unix::import ?ns? ?arg...? ::term::ansi::ctrl::unix::raw ::term::ansi::ctrl::unix::raw ::term::ansi::ctrl::unix::columns ::term::ansi::ctrl::unix::rows _________________________________________________________________ DESCRIPTION
WARNING: This package is unix-specific and depends on the availability of two unix system commands for terminal control, i.e. stty and tput, both of which have to be found in the $PATH. If any of these two commands is missing the loading of the package will fail. The package provides commands to switch the standard input of the current process between raw and cooked input modes, and to query the size of terminals, i.e. the available number of columns and lines. API
INTROSPECTION ::term::ansi::ctrl::unix::import ?ns? ?arg...? This command imports some or all attribute commands into the namespace ns. This is by default the namespace ctrl. Note that this is relative namespace name, placing the imported command into a child of the current namespace. By default all commands are imported, this can howver be restricted by listing the names of the wanted commands after the namespace argument. OPERATIONS ::term::ansi::ctrl::unix::raw This command switches the standard input of the current process to raw input mode. This means that from then on all characters typed by the user are immediately reported to the application instead of waiting in the OS buffer until the Enter/Return key is received. ::term::ansi::ctrl::unix::raw This command switches the standard input of the current process to cooked input mode. This means that from then on all characters typed by the user are kept in OS buffers for editing until the Enter/Return key is received. ::term::ansi::ctrl::unix::columns This command queries the terminal connected to the standard input for the number of columns available for display. ::term::ansi::ctrl::unix::rows This command queries the terminal connected to the standard input for the number of rows (aka lines) available for display. BUGS, IDEAS, FEEDBACK This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category term of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for either package and/or documentation. KEYWORDS
ansi, columns, control, cooked, input mode, lines, raw, rows, terminal CATEGORY
Terminal control COPYRIGHT
Copyright (c) 2006 Andreas Kupries <andreas_kupries@users.sourceforge.net> term 0.1 term::ansi::ctrl::unix(n)
All times are GMT -4. The time now is 08:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy