LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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


Reply
  Search this Thread
Old 06-06-2009, 04:52 AM   #1
autophil
Member
 
Registered: Jun 2006
Location: Macclesfield Canal, East Cheshire
Distribution: Salix-14.1
Posts: 129
Blog Entries: 1

Rep: Reputation: 15
to halt a process


Is there a way to halt a process. I know you can type in ps and it gives a rather cryptic list of running processes. But say you exit a program's gui and the next time you want to start it you get an error message to say thet the program is still running. A command to exit the program rather than reboot the whole system.
 
Old 06-06-2009, 05:03 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

You need to find the PID (Process ID) of the program that is still running and kill it.

You can use ps -ef | grep "nameofprogram" | grep -v grep to get the PID(s) and kill <pid> to stop the program in question.

The PID can be found in the second column of the ps -ef command.

Example, kill mplayer:
Quote:
$ ps -ef | grep mplayer | grep -v grep
druuna 3837 1 1 12:02 tty1 00:00:00 /usr/bin/mplayer

$ kill 3837
 
Old 06-06-2009, 05:44 AM   #3
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
Be aware that some programs might catch certain signals that you provide with kill (see man kill).

So a normal kill (as used in the example above) might not always kill the process. You're last resort will be kill-9 pid_of_process. Use this, however, with care as it does not allow the process that you're killing to cleanup temporary files etc and you might have some cleaning up to do before you can start the process again.
 
Old 06-06-2009, 05:45 AM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Or simply
Code:
pkill -9 mplayer
 
Old 06-06-2009, 07:07 AM   #5
autophil
Member
 
Registered: Jun 2006
Location: Macclesfield Canal, East Cheshire
Distribution: Salix-14.1
Posts: 129

Original Poster
Blog Entries: 1

Rep: Reputation: 15
Thanks gentlemen!
 
Old 06-12-2009, 12:19 PM   #6
autophil
Member
 
Registered: Jun 2006
Location: Macclesfield Canal, East Cheshire
Distribution: Salix-14.1
Posts: 129

Original Poster
Blog Entries: 1

Rep: Reputation: 15
I tried all of these things but even after a reboot I get the message: Thunderbird is already running but is not responding. To open a new window you must first close the existing Thunderbird process or restart your system.
When I type in any of the ps commands I cant pick out a process name that looks like Thunderbird.
 
Old 06-12-2009, 12:33 PM   #7
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
It has left a lock file that you will need to remove. Consult the Thunderbird documentation.
 
Old 06-16-2009, 03:07 AM   #8
autophil
Member
 
Registered: Jun 2006
Location: Macclesfield Canal, East Cheshire
Distribution: Salix-14.1
Posts: 129

Original Poster
Blog Entries: 1

Rep: Reputation: 15
Yeah Im still following that up. I have deleted all of the *./lock files that look anything to do with Thunderbird. But it still wont open up!
So what is the essential file to carry over to a new install that will keep the old mail available? And settings.

Last edited by autophil; 06-16-2009 at 03:22 AM.
 
Old 06-16-2009, 03:21 AM   #9
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Quote:
Originally Posted by autophil View Post
So what is the essential file to carry over to a new install that will keep the old mail available?
You can copy the directory $HOME/.thunderbird/<random-string>/Mail, then you will pick all the files Inbox, Sent, etc. and the related index Inbox.msf, Sent.msf, etc. If you have subfolders, you will find them under Inbox.sbd, Sent.sbd, etc. Also the file msgFilterRules.dat can be useful if you have set-up some filter rules.

Here is an example on my system:
Code:
$ cd /home/colucix/.thunderbird/vk6ww3vr.default/Mail
$ ls
Local Folders  account.domain.it
$ cd account.domain.it
$ ls
Drafts      filterlog.html  Inbox.msf  msgFilterRules.dat  Sent      Sent.sbd       Trash
Drafts.msf  Inbox           Inbox.sbd  popstate.dat        Sent.msf  Templates.msf  Trash.msf
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Tried to hibernate; wpa_supplicant refused to freeze; process unkillable; cannot halt AlucardZero Linux - Wireless Networking 3 01-11-2019 03:22 PM
Finding the Process ID of a Process While Initiating the Process senthilmuthiah Linux - Newbie 7 04-02-2009 10:37 AM
halt sethgeekx86 Slackware 1 04-20-2004 12:07 PM
Don't halt? tr4nce Slackware 3 03-22-2003 09:15 AM
halt...by yourself please da Perp Linux - Newbie 2 12-21-2001 01:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:38 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