HPE GreenLake Administration
Operating System - HP-UX
1833790
Members
2816
Online
110063
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2008 04:24 AM
10-18-2008 04:24 AM
Kill
Could you please explain the difference between kill -9 and kill-15 commands
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2008 04:38 AM
10-18-2008 04:38 AM
Re: Kill
Hi,
Refer following link to make it more clear:
http://docs.hp.com/en/B9106-90007/kill.1.html
In short:
9 SIGKILL Kill Forced termination; cannot be trapped
15 SIGTERM Terminate Terminate; can be trapped
-R.K.
Refer following link to make it more clear:
http://docs.hp.com/en/B9106-90007/kill.1.html
In short:
9 SIGKILL Kill Forced termination; cannot be trapped
15 SIGTERM Terminate Terminate; can be trapped
-R.K.
Don't fix what ain't broke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2008 03:59 PM
10-18-2008 03:59 PM
Re: Kill
kill -9 is a VERY dangerous command because most beginner books use it way too generously. kill -9 stops the program from executing. It gives the program no chance to write memory information, or to close files properly. In a database program, this almost guarantees corruption and a long database recovery process.
The kill command does not actually kill the program. Instead, it is a signal to the program. This signal goes into the process table and the next time the program starts t run, it will see the signal. Now what happens next is completely under the control of the programmer (except kill -9, see below). The programmer can choose to completely ignore the signal in which system defaults will stop the program, and in the case of kill -3 or kill -11, the program will be forced to create a core dump.
But a senior programmer will always handle the different signals in an organized way. For instance, kill -15 (also, kill without any option = -15) might start a normal end of job and the process will close files and flush memory in a controlled way. A kill -1 is normally sent when the connection to the program is terminated (in the old days, the modem would disconnect or hang up), so a program might handle this condition in a slightly different way.
kill -9 should be used only as a last resort but it will do nothing if the process is not running, as in waiting for an I/O to complete. In badly written application programs, a network I/O is initiated without any timeout and when a problem occurs in the network, the program can never be killed. kill -9 sets the flag but the program isn't running.
SO tghe first command to stop a program would be to use kill (with no signal number) or kill -15. Check if the program has stopped with ps. If it has not stopped after 5-10 seconds, try kill -1 to signal the program that it has been disconnected from any terminal I/O. If there is a programmer that can read the core file, then use kill -3 if kill -15 and kill -1 do not work.
Bill Hassell, sysadmin
The kill command does not actually kill the program. Instead, it is a signal to the program. This signal goes into the process table and the next time the program starts t run, it will see the signal. Now what happens next is completely under the control of the programmer (except kill -9, see below). The programmer can choose to completely ignore the signal in which system defaults will stop the program, and in the case of kill -3 or kill -11, the program will be forced to create a core dump.
But a senior programmer will always handle the different signals in an organized way. For instance, kill -15 (also, kill without any option = -15) might start a normal end of job and the process will close files and flush memory in a controlled way. A kill -1 is normally sent when the connection to the program is terminated (in the old days, the modem would disconnect or hang up), so a program might handle this condition in a slightly different way.
kill -9 should be used only as a last resort but it will do nothing if the process is not running, as in waiting for an I/O to complete. In badly written application programs, a network I/O is initiated without any timeout and when a problem occurs in the network, the program can never be killed. kill -9 sets the flag but the program isn't running.
SO tghe first command to stop a program would be to use kill (with no signal number) or kill -15. Check if the program has stopped with ps. If it has not stopped after 5-10 seconds, try kill -1 to signal the program that it has been disconnected from any terminal I/O. If there is a programmer that can read the core file, then use kill -3 if kill -15 and kill -1 do not work.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2008 05:18 PM
10-18-2008 05:18 PM
Re: Kill
Instead of Bill's kill -1, etc, you might want to use their names:
kill -HUP # -1
kill -QUIT # -3
kill -TERM # -15
Use "kill -l" to list.
You can continue to use -9. :-)
kill -HUP # -1
kill -QUIT # -3
kill -TERM # -15
Use "kill -l" to list.
You can continue to use -9. :-)
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP