LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Unable to kill process (https://www.linuxquestions.org/questions/linux-general-1/unable-to-kill-process-424341/)

rvsridhar 03-13-2006 04:13 AM

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.

reddazz 03-13-2006 04:24 AM

Did you try "killall mv".

rvsridhar 03-13-2006 04:35 AM

Thanks for your reply

I tried with the command "Killall mv", But i could'nt terminate the processes

marozsas 03-13-2006 07:42 AM

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".

timmeke 03-13-2006 07:55 AM

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.

marozsas 03-13-2006 08:07 AM

Good point timmeke. Sometimes a defective disk blocks a write operation.


All times are GMT -5. The time now is 04:24 AM.