LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-10-2008, 08:54 PM   #1
katesfb
Member
 
Registered: Nov 2006
Posts: 58

Rep: Reputation: 15
How to kill "locked up" applications


Hi,
When an application "locks up" so that it is no longer responding or is not responding as it should is there a way to kill it? IN windows CTRL ALT DEL will bring up a sreen that will allow you to kill the application.

For example i recently installed xubuntu and have had a number of issues one of which seems to be firefox locking up (seems to occur most while watching flash video content) - i can minimise the window but cant do anything else and also cant start another firefox. I know that the command kill (pid) can kill the application and the pid number can be obtained from the TOP command but when an application locks up it doesnt appear in the TOP output.

Is there another way? Any help would be much apreciated.

Also i recently downgraded from firefox 3.1 back to firefox 2 to try to aleviate some of the issues i was having and while it is running better i am still getting lock ups - see above. However having downgraded, links that would have automatically started firefox 3.1 are no longer working for firefox 2. Can this be fixed.

Cheers.
 
Old 09-10-2008, 09:09 PM   #2
mjmwired
Member
 
Registered: Apr 2004
Distribution: CentOS6, CentOS5, F16, F15, Ubuntu, OpenSuse
Posts: 620

Rep: Reputation: 39
Open a shell and type:
# ps -ef
Look for the process id (PID), and type:
# kill -9 PID
 
Old 09-10-2008, 09:13 PM   #3
{BBI}Nexus{BBI}
Senior Member
 
Registered: Jan 2005
Location: Nottingham, UK
Distribution: Mageia 6, KDE Neon
Posts: 4,313

Rep: Reputation: 212Reputation: 212Reputation: 212
Quote:
Originally Posted by katesfb View Post
Hi,
When an application "locks up" so that it is no longer responding or is not responding as it should is there a way to kill it? IN windows CTRL ALT DEL will bring up a sreen that will allow you to kill the application.

For example i recently installed xubuntu and have had a number of issues one of which seems to be firefox locking up (seems to occur most while watching flash video content) - i can minimise the window but cant do anything else and also cant start another firefox. I know that the command kill (pid) can kill the application and the pid number can be obtained from the TOP command but when an application locks up it doesnt appear in the TOP output.

Is there another way? Any help would be much apreciated.
Yes.
Code:
Alt+Ctrl+Esc
This should turn your cursor into a skull & crossbones now click the app you want to kill.
Code:
Ctrl+Esc
Should bring up a graphical task manager that you can also use to kill apps/processes.
Quote:
Also i recently downgraded from firefox 3.1 back to firefox 2 to try to aleviate some of the issues i was having and while it is running better i am still getting lock ups - see above. However having downgraded, links that would have automatically started firefox 3.1 are no longer working for firefox 2. Can this be fixed.

Cheers.
Normally it's just a case of editing the links to point them at the firfox 2 directory.
 
Old 09-10-2008, 09:22 PM   #4
ryedunn
Member
 
Registered: Jul 2003
Location: Chicago
Distribution: Fedora, ubuntu
Posts: 459

Rep: Reputation: 30
A full system crash is very rare in Linux, most of the times it is only one program that acts up. There are several ways to recover from a crashed program.

1). If a program blocks, crashes or runs-away ( does not want to close or stop running ), change desktop and press the Ctrl+Esc keys. You will get the Process Table with all processes running on your system ( some processes may appear several times, that is normal ) the first four columns are the most important, if you know the name of the process things are simple, if you don't: in the 3rd and 4th you can see what is consuming all that cpu. Now remember or note down the PID number ( Process IDentifier ) you will need this. ( for multiple processes with the same name only the last one is the one you're after ).
Now go to yet another desktop open a terminal/console type < su > ( without the <> ) and give your root password, then type < kill 4246 >; ( if 4246 was the pid number ).
That's all, job done ! ( rebooting like in Windows is NOT needed in Linux !)

(There are other ways with names instead of numbers, terminal instead of gui process table, but this is the most general way to save your butt )

2). If all your desktops are blocked ( when X crashes): Press Ctrl+Alt+F1, you will go out of X, and get an empty terminal screen, fully black with a login prompt. ( there are 6 terminals available F1 to F6 ) Then log in as "root" ( not "su" this time ) and type <top>, you will get the same process-table with the PID numbers, find the number that's hurting, close top with the"Q" key, press Alt+F2, you will get a second black screen ( terminal ) to log in to, log in as root and < kill 4246 >.
For returning to X, press Alt+F7 !

3). Also you can try Ctrl+Alt+Backspace . . . it will log you out of X and bring you back to the graphical login screen where you can start KDE or Gnome again.

4). If even this does not help or you can not find the process and PID number just type "reboot" at the root-prompt ( of a Ctrl+Alt+F1 terminal ) and you will get a clean reboot.

5). If even this last step does not work...( Or: If All Else Fails )


In addition to the PID story in Run-Away Processes If all is blocked and even Ctrl+Alt+backspace ( what should be a last resort ) does not react, if your system does not react on any action ( like I said before, very rare in Linux ) remember the next line:


Raising Skinny Elephants Is Utterly Boring


Here is how you "raise the elephant":

Alt+SysRq+r ( The LEFT Alt key ) ( SysRq is on the same button as print screen )
Alt+SysRq+s
Alt+SysRq+e
Alt+SysRq+i
Alt+SysRq+u
Alt+SysRq+b


Give a little time between keystrokes.

The r stands for put keyboard in raw mode
The s for sync the disk
The e for terminate all processes
The i for kill all processes
The u for remount all filesystems read only
The b for reboot the system

THIS IS THE VERY LAST SAVE YOUR BUTT PROCEDURE ! ONLY IF ALL ELSE FAILS !

PS: If your filesystem is Ext3 or ReiserFS and on reboot it wants you to do a filesystem check, don't touch any key when it asks you to press "Y" and let it recover the journal automatically.

NOTE: For the skinny elephants to work you need to have the sysrq-key enabled in the kernel. (CONFIG_MAGIC_SYSRQ)
You can check if it is enabled by typing 'ls /proc/sys/kernel/sysrq' if it's there, it's enabled.
Thanks to Mischa for pointing this out.


**NOTE: This was copied directly from www.brunolinux.com **
 
Old 09-10-2008, 09:23 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
ps -ef|grep -i <string_in_name_of_app>

should narrow it down for you
 
Old 09-10-2008, 11:23 PM   #6
katesfb
Member
 
Registered: Nov 2006
Posts: 58

Original Poster
Rep: Reputation: 15
HI,
Thanks for all the replies - it has been an immense help. Yes it is definitely one of the bonuses of linux that there is just about always a command or something to achieve just about anything - its just a case of knowing what that is.

I have one more question: whats the best alternative to firefox? I have been using epiphany as a browser while firefox has been playing up and it seems quite good and has yet to lock up. Maybe we could have a poll of the best web browser?

Again, thanks for all your help.
 
Old 09-10-2008, 11:25 PM   #7
{BBI}Nexus{BBI}
Senior Member
 
Registered: Jan 2005
Location: Nottingham, UK
Distribution: Mageia 6, KDE Neon
Posts: 4,313

Rep: Reputation: 212Reputation: 212Reputation: 212
I use Opera. Standby to be snowed under with other recommendations
 
Old 09-10-2008, 11:43 PM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Must be something weird about your install. I've got FF2 on Fedora 8 and its been just peachy
Have you got any FF extensions installed?
I always use NoScript and Flashblock. They work just fine.
 
Old 09-11-2008, 12:08 AM   #9
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,671
Blog Entries: 4

Rep: Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945
Couple of comments to this...
  1. The "magic SysRq" sequences can be omitted in the kernel-configuration. I have no need for them and therefore do have them turned-off on my box.
  2. On my laptop, pressing the On/Off button once causes an orderly shutdown. Very nice...

Linux has a multi-layered architecture in its GUI that Windows does not match. This means that, "even if the GUI has 'locked-up hard,'" Linux itself has not. You can actually restart the graphic system without restarting Linux itself. Windows uses a different software architecture in this regard, which makes such recovery steps considerably more difficult.
 
Old 12-02-2008, 10:00 AM   #10
MHull
LQ Newbie
 
Registered: Dec 2008
Posts: 2

Rep: Reputation: 0
I don't know if this is the right place to ask this but here goes...I am trying to open my StarOffice program on my ASUS EEEPc 1000 which uses Linux as its operating system. When I try to open the program I get a window saying the following: another instance is accessing my personal settings or that my personal settings are locked and that I need to make sure 'user' closes my StarOffice program on host 'asus 99038169'
How exactly do I do that? I am a very inexperienced Linux user.
Thanks for any help!

Last edited by MHull; 12-02-2008 at 10:01 AM. Reason: don't know if this is the right forum
 
Old 12-03-2008, 07:47 AM   #11
dickgregory
Member
 
Registered: Oct 2002
Location: Houston
Distribution: Arch, PCLinuxOS, Mint
Posts: 257

Rep: Reputation: 34
MHull, you got the right forum, but you likely will not get very much exposure by tagging your inquiry at the bottom of an existing thread.

Try opening your own thread with a properly worded subject line and state your question there. People who scan the forums in order to help people will frequently only open posts that have a subject line that looks like an area where they have expertise. So use wording that will attract the attention of the person you would like to help you.
 
Old 12-03-2008, 08:40 AM   #12
{BBI}Nexus{BBI}
Senior Member
 
Registered: Jan 2005
Location: Nottingham, UK
Distribution: Mageia 6, KDE Neon
Posts: 4,313

Rep: Reputation: 212Reputation: 212Reputation: 212
Quote:
Originally Posted by MHull View Post
I don't know if this is the right place to ask this but here goes...I am trying to open my StarOffice program on my ASUS EEEPc 1000 which uses Linux as its operating system. When I try to open the program I get a window saying the following: another instance is accessing my personal settings or that my personal settings are locked and that I need to make sure 'user' closes my StarOffice program on host 'asus 99038169'
How exactly do I do that? I am a very inexperienced Linux user.
Thanks for any help!
See my post #3.
 
Old 12-04-2008, 07:27 AM   #13
MHull
LQ Newbie
 
Registered: Dec 2008
Posts: 2

Rep: Reputation: 0
Thanks for the replies! My original hesitation to do anything was because I didn't actually have the application open and was afraid to 'kill' anything that as far as I knew wasn't open. In the mean time, the next time I turned on the computer everything worked as normal and whatever had locked my personal info seems to have turned itself off. Am still thinking ???? is going on. Just for future reference what exactly is the wording to put into a terminal to close something?
Thanks again
 
Old 12-04-2008, 07:49 AM   #14
lakedude
Member
 
Registered: Jun 2005
Distribution: Puppy, Sabayon
Posts: 141

Rep: Reputation: 16
Quote:
Originally Posted by katesfb View Post
Hi,
When an application "locks up" so that it is no longer responding or is not responding as it should is there a way to kill it? IN windows CTRL ALT DEL will bring up a sreen that will allow you to kill the application.
One of the things I love about Linux is the KILLing. Puppy Linux has a KILL option if you just right click on a misbehaving program.

Sabayon includes a graphical KILL option as well. I put a shortcut to xKILL in the taskbar with a skull icon. I'm sure you could do something similar with your distro...

http://en.wikipedia.org/wiki/Xkill

"Just click the bad thing with the skull and it dies."

Last edited by lakedude; 12-04-2008 at 07:50 AM.
 
Old 12-04-2008, 09:18 AM   #15
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
man killall

option -9 is useful
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Use only one "kill" to kill father and child processes Xosen Programming 7 08-28-2008 03:33 AM
run adapt but "package system database is locked" ctdarksilver Ubuntu 4 08-24-2006 04:27 AM
"vsFTPD is dead but syskey locked" in RH9 services. SPo2 Linux - Networking 3 06-26-2006 11:16 PM
External Hard Drive "locked" in Mandriva 2006 VapourTrail Linux - Software 1 03-04-2006 12:53 AM
suse 10.0 => processes "sending kill signal": "done, done, missing"...!? ungua Linux - Newbie 2 01-18-2006 10:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration