LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 05-16-2008, 09:00 AM   #1
yuxingpiao
LQ Newbie
 
Registered: May 2008
Posts: 5

Rep: Reputation: 0
Smile How to kill processes using fuser?


Hi, Everybody.
I have some problems using fuser.
I want to kill processes accessing a certain block file, eg /dev/sda6 and decided to use fuser.
But some programs are not mapped and killed.
I ran openoffice word processor, gedit, kwrite and opened some text and doc files on /dev/sda6.
Then ran the following command on the terminal.

[root@localhost ~]# fuser -mv /dev/sda6
USER PID ACCESS COMMAND
/dev/sda6: root 3587 F.... swriter.bin
[root@localhost ~]# fuser -km /dev/sda6
/dev/sda6: 3587

As you see, only word processor was mapped and killed.
Nothing happened about gedit and kwrite, even though I had root privilege
I don't know how to solve this problem and have some other problems.
My target is to close all applications accessed /dev/sda6, saving their opened files.
Do you have any suggestion?
Please help me out.
Best regards to you...
 
Old 05-16-2008, 09:18 AM   #2
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Are you sure the files actually were open at that time? Because at least some (text) editors work so that they don't work on the actual file, but rather work on it's copy, and when you save, the changes are then written to the file. That way the original file does not need to be open all the time, potentially causing some trouble (and that's why the editors, or some of them at least, can warn you if the original file was edited by some other process). I could be wrong, but check it to make sure.

The copy would of course still exist on the same directory (or so I think), but it's also possible that the contents are kept in a buffer and the file - be it the original file or copy - is only open when it's being read or written. Namely just when you open or save, or if the app automatically saves changes at intervals to keep it "safe" - and these "autosaves" it probably puts into the cache file rather than the original. Usually these "cache files" have the same filename as the original, but a tilde ~ added to it.

Last edited by b0uncer; 05-16-2008 at 09:21 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Can't kill certain processes.... Basslord1124 Slackware 2 01-29-2008 10:28 AM
how to kill processes htamayo Linux - Newbie 2 09-25-2007 10:27 AM
IRIX64 ... need to kill processes! jhwilliams Other *NIX 1 07-15-2007 11:24 PM
script to kill processes tradnbillies Linux - Software 2 04-28-2006 03:00 PM
how to use kill to kill a batch of processes with same name? dr_zayus69 Linux - Software 2 09-03-2005 06:35 PM

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

All times are GMT -5. The time now is 01:11 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration