Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
Due to network maintenance being performed by our provider, LQ will be down starting at 05:01 AM UTC. The exact duration of the downtime isn't currently known. We apologize for the inconvenience.
|
 |
03-10-2012, 04:36 PM
|
#1
|
|
Member
Registered: Jan 2009
Location: India
Distribution: Porteus atma
Posts: 84
Rep:
|
Assigning a button for top or htop.
When some program chocks the CPU or memory to 100%, the keyboard too hangs.
I want to assign a button (like the lid close button or power button) for calling top or htop with nice -20 so that i can kill the application.
The script which keeps watch of this event has be running with -20 nice number.
Is this a good idea to implement? Any ideas?
-cheers
indiajoe
|
|
|
|
03-10-2012, 04:50 PM
|
#2
|
|
Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 11,805
|
Quote:
Originally Posted by indiajoe
When some program chocks the CPU or memory to 100%, the keyboard too hangs.
I want to assign a button (like the lid close button or power button) for calling top or htop with nice -20 so that i can kill the application.
The script which keeps watch of this event has be running with -20 nice number.
Is this a good idea to implement? Any ideas?
|
Doesn't make alot of sense to me. If the keyboard hangs, then ANY key/button on your system will also be affected and hang. You could just use whatever your GUI manager (Gnome/KDE) keyboard settings to program a key to run whatever script you want, but again, if the keyboard hangs, that will ALSO hang, so you're right back where you started.
|
|
|
|
03-11-2012, 03:26 AM
|
#3
|
|
Member
Registered: Jan 2009
Location: India
Distribution: Porteus atma
Posts: 84
Original Poster
Rep:
|
I was thinking of situations when it is not completely hung. Mostly my system only gets extremely slow. So do you think that running a script which watches for a particular key stroke and run top with nice -20 will be as good as assigning it to any other button on my laptop?
(Many a times i have noticed that the power button starts shutdown even when my keyboard is responding very slow)
Thanking you,
indiajoe
|
|
|
|
03-11-2012, 06:00 AM
|
#4
|
|
Moderator
Registered: May 2001
Posts: 24,805
|
Linux is quite efficient in how it utilizes and shares available resources among processes. Instead of searching for a way to kill processes you should find out what is or are the bottlenecks and how to make those processes play nice (more RAM, review processor and disk energy-saving states, different type of scheduler, process niceness, ionice, running certain processes sequentially like cronjobs, etc, etc). Basic tools to gather resource statistics (aka SAR) are Atop, Dstat and collectl.
|
|
|
1 members found this post helpful.
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 09:33 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|