LinuxQuestions.org
Visit Jeremy's Blog.
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 03-13-2006, 04:13 AM   #1
rvsridhar
LQ Newbie
 
Registered: Mar 2006
Posts: 13

Rep: Reputation: 0
Unable to kill process


Hi,

I am Moving my files to USB drive from Local Hard disk using MV command with cron job. After some time i was unable to browse my USB drive. Later i found there a many process of MV command. I tried to kill the process, but they are not getting ternimated. I found that 226 MV commands are running process.

Command used to kill

Kill -TERM 12345
Kill -HUP filename

i tried with many options, but i could'nt kill the process

please anybody could help me in ternimating these process.


Thanking you,

Sridhar.
 
Old 03-13-2006, 04:24 AM   #2
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
Did you try "killall mv".
 
Old 03-13-2006, 04:35 AM   #3
rvsridhar
LQ Newbie
 
Registered: Mar 2006
Posts: 13

Original Poster
Rep: Reputation: 0
Thanks for your reply

I tried with the command "Killall mv", But i could'nt terminate the processes
 
Old 03-13-2006, 07:42 AM   #4
marozsas
Senior Member
 
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,499
Blog Entries: 2

Rep: Reputation: 68
Use the code to kill mv
Code:
while (/bin/true) do
pidlist=$(ps -ef | grep -w mv | grep -v grep | awk '{print $2}')
kill -KILL $pidlist
sleep 1
done
When this loop start to output something like "kill: usage: " you are done.

In other terminal, edit your crontab job, putting a comment in the begin of line or removing it at all.

cheers,

PS: The "grep -w mv" is a bit generic. May be you can add some more specific thing like "mv /whatever".

Last edited by marozsas; 03-13-2006 at 07:46 AM.
 
Old 03-13-2006, 07:55 AM   #5
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
Or maybe his processes are all hanging on some ininterruptable I/O system call?

@rvsridhar, can you please post the output of
Code:
ps -efl | grep -i mv
and indicate which of the mentioned processes are the "mv"s that seem to be hanging.
 
Old 03-13-2006, 08:07 AM   #6
marozsas
Senior Member
 
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,499
Blog Entries: 2

Rep: Reputation: 68
Good point timmeke. Sometimes a defective disk blocks a write operation.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
cannot kill process (kill -9 does not work) mazer13a Linux - General 1 05-27-2005 02:32 PM
kill a process bratch Linux - Software 9 04-13-2005 06:00 PM
Unable to kill Java process on Fedora Core 2 eblack Fedora 10 04-07-2005 02:49 AM
Why can't I kill this process? solking Linux - General 5 10-29-2003 11:24 AM
How to kill a certain process? AMDPwred Linux - General 3 10-01-2002 01:40 PM

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

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