Dealing with Runaway Processes

Have you ever been using your Linux distro and suddenly found a program won’t close? It’s frustrating when an application hangs. In Windows, one could right click on the taskbar and choose “Task Manager” and kill the hanging process (which doesn’t always work BTW). In Linux, you can also kill these hanging processes.

First, if you’re using KDE press Control-Escape. This will give all processes in a handy window called the KDE System Guard. Clicking the column heading for “System %” so the arrow on it appears facing up will sort the processes from highest system percentage to lowest. Find the process that seems to be hogging up all the resources (or if you know the name of the process, highlight that) and then hit the kill button. Your process should end it’s routines and exit.

You can also check out which program is hogging up your virtual memory with its process which can also slow things up. Clicking on the column “VmSize” and sorting largest to smallest will allow you to see this and select which process to kill. I often elect to select only user processes using the drop down menu at the top right hand corner of the KDE System Guard. Doing this filters out all system files and shows any hanging applications that are initiated by the user (which is often what is hanging for me).

Don’t worry if you see the same process more than once (for example, Apache or php may have multiple entries if you run a webserver…this is normal). If you’re using Gnome, you’ll either have to use the console method I explain below or launch the Gnome System Manager to get things rolling. Since I don’t use Gnome, I won’t cover the Gnome System Manager here.

Another way you can do things…especially if all Xwindows (KDE, Gnome, Fluxbox, etc) have frozen or are sluggish is to drop to a console. You can do this by killing the Xserver or by dropping to a console. You can press Alt-F2 or Alt-F3 and get directly to a console. Login as root. Now let’s take a look and see what processes are hogging up resources. Kill the Xserver and drop to a console by hitting Control-Alt-Backspace. For our purposes, I’ll assume you’ve made it to the console now.

There’s a quick console way of finding exactly what is consuming the most of your PC as far as processes are concerned. Using the the ‘top’ command will display those processes that are beasts and allow you to take note of them. Look for the process taking up the most CPU% (which should appear at the ‘top’ of your ‘top’ output). Pay specific attention to the PID column of that high CPU% item and make a note of it. This is the process ID number and every program running on a Linux box is assigned one by the Kernel. We’ve found the one making problems for us and have recorded the PID so let’s slay it. Hit Control-C to stop the top command and then type:

kill PID

Where PID is the process ID number you made a note of before. You may not get confirmation that the task has been immediately killed so let’s see if it is still running. We may not get the information we need by using top again since it is mainly for finding the higher consuming processes aka runaways. Instead, let’s use the ps command.

ps aux | more

This command outputs all processes in a nice way…using the | and ‘more’ command allows you to paginate the output so that if there are a TON of processes, you can use the spacebar or arrow keys to page down (you can do that with any command too BTW). Now look for that PID that we just killed in the second column and see if it is there. You could also get creative and use:

 ps aux | grep PID

Where PID is once again the PID you killed. The grep command will search through the results and echo back to you any matching entries it finds. If you didn’t find anything and couldn’t match your PID to that of any displayed in your ps aux command, you just successfully killed that beastly process. As always, for more information, please see the man pages (e.g. man ps or man top).

Hopefully, this allows you to more efficiently manage your processes…runaway or normal. If I’ve printed an error, please let me know via the comments below or if there is a more efficient way of doing things let me know there as well…I’m always open to improvement.

UPDATE: Please checkout the comments section for a few more tips on killing processes!

UPDATE2:  Reader Scott M writes in the comments below “You don’t have to use the PID. You can use the -f option.  e.g. if there are multiple instance of SomeProgram, you can kill them all with one command:

pkill -9 -f SomeProgram”  Thanks Scott!

Dell Dimension E521 with Linux

I bought a Dimension E521n to replace my server last week. I previously built a system myself with an AMD Duron Processor and an add on IDE Controller so I could load it up with hard drives for a file server. The only downside to this was that the fan I bought for this server I built was loud…REALLY loud. When we moved to a different apartment this past year we lost our spare room (office) and the computer went into my bedroom.  Needless to say, it’s LOUD at night when sleeping.

To replace this loud server I bought the E521-n series so Microsoft didn’t get any of my money. For those of you who don’t know, the N series desktops from Dell come with no operating system. Dell also claims that these computers are ‘ready for Linux’…but there are some problems associated with them. I was able to get ClarkConnect back on my server and pop in the IDE Controller PCI card (E521’s are completely SATA) after solving a couple of problems.

First and foremost, you have to make sure your E521 is running BIOS version 1.1.4 (Released January 2007). If you don’t, you’ll have USB problems all over the place. Second, when booting Linux, add the boot parameter acpi=noirq. If you can’t pass this parameter to your kernel you may need to completely turn off acpi using the ‘noacpi‘ parameter. The only downside to this is that your fan will run continuously and cause a bit more noise than it should.

When installing ClarkConnect 4.0, there is a routine for adding parameters to the kernel before GRUB writes to the MBR. I used this to pass the acpi=noirq parameter and after booting everything worked. Without passing this parameter, I received Kernel panics.

It’s also been reported that some kernels cannot find the broadcom module for the onboard LAN device. With ClarkConnect, this wasn’t a problem. I’ve heard that the Fedora Xen kernel has problems with this.

I’m going to list some links here for your reference that helped me in my quest:

ClarkConnect
Dell E521 and Linux Wiki Page
Yet Another Linux Blog and the USB Problem
Hardware Support for E521 N Series @ Ubuntu Forums

Hope this information helps someone with their problems! For those of you running Ubuntu, you’ll have to add ‘noapic irqpoll pci=routeirq’ to your boot parameters to get things rocking.

Going Fishing for a WinSCP Replacement?

So you’ve got insert_linux_distro_name_here installed and you’re ready to get started with your standard computing day. You’ve only recently converted to this Linux thing. You know enough about Linux to install it and have it up and running for your main desktop. You’ve slowly begun easing yourself into this new Linux role by replacing the applications you used in Windows with free and open source ones installed or installable on Linux.

Today, your mission is to replace WinSCP. You scan through your distro repositories and ask questions in various forums looking for that WinSCP replacement. Sound familiar? It should. I’ve seen this question in many forums and have also seen in it many mailing lists. In fact, I’ve asked this very question myself. WinSCP was a program I had been using for years in Windows. I found it to be one of the best free programs available for the Windows platform for SFTP and SSH connections and file transfers.

The interesting part is that I didn’t need to ask these question. Had I searched for the right terms like “SCP Client Linux” (instead of googling “winscp replacement linux”) I would have found that Linux has a very good replacement in FISH. So if you are searching for a WinSCP replacement after converting into this Linux thing…please read on. You’ll be shocked and amazed that Windows doesn’t have some new fandangled technology like this :p Not only has fish simplified my server administration tasks…it’s revolutionized the way I manage my information on the 5 websites I have. To top it off, it’s built into the Konqueror file manager in KDE which is my primary desktop.

Continue reading “Going Fishing for a WinSCP Replacement?”

Dell E521, Linux, Freezing USB Mouse Problem Resolved

I hit a snag this past week while testing a few beta releases with the latest kernels. I bought an AMD X2 3800 Dell E521 with a Gig of RAM for US $409 and free shipping during a dealnews.com dealfest…I feel I got a good deal. So I’ve been waiting to put my favorite distro, PCLinuxOS on it…waiting for the release of .94 due out sometime this month. In the meantime, Windows XP has been on that computer and I’ve been dual booting distros I’d like to try.

The snag I hit came when booting into just about any 2.6.X environment in Linux…the mouse would be fine one minute, and then a few minutes into things the mouse would freeze. This is a USB Logitech mouse…and I found it odd that it would freeze up but the printer (HP PSC 1210v) would work just fine.

After a bit of research when pointed in the right direction of the kernel developer for PCLinuxOS, I came to realize that I wasn’t alone. Many on Ubuntu’s forums and also Linuxquestions, and Linuxforums had reported the same problems…most without any resolution. The good news is that I found a resolution to my problems 😀

Update the BIOS! I did a major forehead smack when it was the last thing I thought of when it should have been the first. After updating the BIOS to the latest and greatest version from dell.com, I was back in business with no freezes of my USB Mouse. Hopefully, if you also run a Dell E521, you won’t bash your head repeatedly against the wall like I did.

5 Unique Tips for New Ubuntu Users

Update! Before you read the article, please note that an inaccuracy of Point Number 3 has been pointed out in comments by cafeina. Thanks for pointing this out…there are downloadable guides for Ubuntu Dapper Drake available at http://help.ubuntu.com. These guides could be much more user friendly (they don’t have pics included) but that they get the job done quite nicely. Thanks for pointing this out Cafeina!

With the popularity of Ubuntu swelling these days, one can hardly visit digg or other tech news sites without seeing a Dapper Drake or Breezy Badger (both recent titles of Ubuntu releases). Another strong indicator that Linux in general, dapper drake aside, may be seeing an influx of users is the news that Microsoft receives a call back from Windows computers daily. Many users expressed deep concern about false positives where Microsoft receives reports that you are using a pirate copy of Windows when you are running a licensed version. Also, why not examine why WGA (Windows Genuine Advantage) fits the bill for Spyware? So, what’s a ticked off user to do? Give Linux the old college try, that’s what!

I’ve seen an influx of people dusting off Mandrake (that’s right, Mandrake not Mandriva…we’re talking pre-name change) and Red Hat 7.2 disks and firing off questions in forums about how to do various things in Linux. Renewed interest in alterntives to Microsoft coupled with big headlines for Ubuntu means many new users are examining Ubuntu when they evaluate (or re-evaluate) the state of Linux. This being said, I have 5 Tips for New Ubuntu Users that you won’t hear anywhere else.

Continue reading “5 Unique Tips for New Ubuntu Users”

KDE Shortcut Keys

Most people know shortcuts in Windows but neglect to find out shortcuts in KDE when they make the switch to Linux. So, if you have a shortcut in KDE that isn’t covered here…please comment it so that others can benefit from your knowledge! PS: Some of these might not work with your version of KDE…just test them out and see if they do!

Alt-F2
Brings up a “Run Command” prompt

Alt-Print and Cntrl-Print
Take a screenshot. You have to paste it from your clipboard

Alt-Esc or Control-Esc
Shows the KDE session manager, from which you can switch to a specific application or log out of KDE.

Ctrl-F[1..8]
Switch to a specific desktop.

Alt-Tab or Alt-Shift-Tab
Cycle through your windows.

Ctrl-Tab or Ctrl-Shift-Tab
Cycle through your desktops.

Alt-F4
Close the current active window.

Ctrl-Alt-Esc
Window destroyer (every window you click on will be destroyed).

Alt-F3
For your Window Menu

Ctrl-Alt-Backspace
This exits KDE but doesn’t save your settings or work.

Ctrl-Alt-Numpad +
Cycles to the next screen resolution available.

Ctrl-Alt-Numpad –
Cycles to the previous screen resolution available.

Hope these help you out…please post any you might have that are helpful and I’ll add them to the list with credits. Thanks again for reading.

Creative Commons License
Except where otherwise noted, the content on this site is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.