![]() |
Horse Menu and killing processes
I have Horse Menu (a great menu widget) which (among many other things) allows me to send certain commands to any process, such as STOP, CONT, KILL, INT, HUP, and TERM. The last 4 seem to quit the process in one way or another. What is the difference between KILL, INT, HUP, and TERM? Which one is the safest to use for quitting a process?
|
pfbbbbbbt and whiney
man kill
and man 2 kill programs have to be written to trap signals from kill |
The man only says what the abbreviations stand for... what is the basic difference, and which is the safest or closest to manually quitting a process?
|
well, all of that is steeped in the traditions of the society of the brotherhood of process management and killing things.
|
either you don't know, or you don't want to tell me :D
(or quite possibly: you don't know AND you don't want to tell me) ;) |
I tried Horse Menu a couple of times so thought I would probably have the ReadMe file kicking around somewhere, but I must have deleted it. In an attempt to answer your question I tried to download it only to find it's dissapeared from VersionTracker and the developer's site reports that it's no longer available. On that note, I'd use it with some caution.
As to your question; from what I can remember only some of the commands you list actually quit the programme. For example, I think that HUP merely suspends the running of a programme rather than quitting it. Have a read of the kill man page which deals with some of the ways in which this command can be used. |
Quote:
By the way, just ignore the crap I posted in my last message about HUP, see: http://www.onlamp.com/...FreeBSD_Basics.html |
Quote:
No way! Quote:
|
Quote:
Quote:
Code:
Some of the more commonly used signals:Other than that I guess you'll have to wake for Merv to take his tablets and return to 'normal' ;) |
[QUOTE]Originally posted by zeb
By the way, the link in your sig points to: http://www.zebelis.com/ ... rather than: http://www.zebellis.com/ i.e. there's an 'l' (ell) missing. |
Quote:
Quote:
-hanging head in shame- "kan't even spel migh own name..." I will fix it at once! |
Quote:
|
Quote:
... that shot... :( it reminds me of home... (unfortunately, there isn't a smiley with tears flying outward from the face) |
Quote:
http://www.virtualhuddersfield.com/trial.htm |
Nice shots of Iceland, Zeb. That's my new favorite place to travel to in Europe.
|
testsignals
Here is a Perl script that you can experiment with to understand the signals better. (As usual, you need to save the script into a file and make that file executable via 'chmod +x'.)
The normal way to exit from this program is by pressing q and then Return. If you exit the normal way, the program gets to do its cleanup routine. If you terminate the program by some other means, it doesn't get to do its cleanup. The main idea I hoped to get across in this example is that what happens when you use 'kill' to terminate a program depends not only on which signal you send, but also on how the program was written - whether it catches signals and what it does with them. Code:
#!/usr/bin/perl -w |
Quote:
hayne - okay, I've saved the file into /usr/local/bin/ and titled it 'killing.sh' (I don't really know why the '.sh') and cd-ed into that directory, typed 'chmod +x killing.sh', then tried typing 'killing.sh' and just 'killing' to call the script, but it keeps saying 'command not found'... as you can see, I know very little about creating custom scripts and executing them... what do I do? |
./killing.sh
the ./ tells it to look in the local directory... otherwise it tries to find the binary following your PATHs. Yep, been there once in March, next trip will be in July of next year. |
Quote:
As for the script: thanks, that got it working. Interesting example, thanks hayne. So it seems like TERM (#15) is the most appropriate out of the original four options... as far as the cleanest way to end a process... if that doesn't actually quit the process, then use KILL (#9)... Is this somewhat accurate? |
It was very beautiful, rugged country.. I didn't make it that far down south(east). Furthest I went was to go up on the small glacier to the west of Jökulsárlón. I got some great pictures as well and I'm not a very good photographer.
I would agree with your assesment of kill. I usually just use 'kill -9' (old habit). |
| All times are GMT -5. The time now is 06:21 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.