LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-23-2009, 07:45 AM   #1
FNC
Member
 
Registered: Feb 2001
Location: South Africa
Distribution: Fedora, Mandriva, PCLOS, SUSE - anything a can get my hands on
Posts: 140

Rep: Reputation: 15
cp process wont die!!!


Hi All,

I have a large tgz file (about 850mb) that I would like to copy to a windows share.

I mounted the windows share with the following in fstab
Code:
//10.206.1.20/Linux /mnt/usb cifs username=user,password=psswd,workgroup=domain
I can then copy the file over using
Code:
cp /path/somefile /mnt/usb
If I look at the shared folder I can see the file being copied, however the cp process never dies. Even when the file is done copying i can still see the process with ps.

This prevents me from unounting the share.

I tried a kill -9 on the cp process but it just wont die.

The only way I can unmount the drive is with umount -l, but even then the cp process is still there.

Is there anyway that I can kill the cp process short of a reboot, and also why does the process hang in the first place.

I would like to make a daily backup of this file using a cron job.

Regards
 
Old 06-23-2009, 08:02 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,830
Blog Entries: 15

Rep: Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668
If the cp process was still active what makes you think the copy was "complete"? Commands "open" files then "close" them when done. The fact the cp command didn't close the file then exit suggests the copy is NOT "complete" even if it looks right to you.

What could cause commands to hang like this is a loss of connection so that the device it is writing to is no longer available. The process hangs because it can't complete because it is waiting on response back from the device but the device is no longer there. Usually this requires a reboot to clear the process due to the odd state of things.
 
Old 06-23-2009, 09:08 AM   #3
FNC
Member
 
Registered: Feb 2001
Location: South Africa
Distribution: Fedora, Mandriva, PCLOS, SUSE - anything a can get my hands on
Posts: 140

Original Poster
Rep: Reputation: 15
Hmmm I never thought of that. I simply assumed that the file was done copying because the file size looked correct, and was not increasing anymore.

So if the connection is lost, is there no way to stop the cp process, or restart it when the connection is back.

Perhaps I'm approaching this whole thing wrong.
 
Old 06-23-2009, 10:25 AM   #4
nuwen52
Member
 
Registered: Feb 2009
Distribution: Debian, CentOS 5, Gentoo, FreeBSD, Fedora, Mint, Slackware64
Posts: 208

Rep: Reputation: 46
First, I've had problems before copying large files across to a windows share. But, I haven't tried one that large in years. The problem with cp is that it really doesn't have an understanding of networking. So, all it knows is that it can't write anymore and patiently waits until it can. I'm going to make a guess why it's locked up. Copying files is at the device level. So, it probably can't be interrupted. Someone with more knowledge in this might be more help.

Is there a reason why you need to do this with a share? Could you instead set up ssh(scp), ftp, rsync or some other kind of server? Or, can the file be broken up and the parts copied? That might help a little with network problems or possible file size restrictions.

Last edited by nuwen52; 06-23-2009 at 10:29 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
When a process just won't die DJOtaku Linux - Software 3 05-11-2005 02:46 PM
The process that WOULDN'T DIE! BertBert Linux - Software 6 04-27-2004 09:13 AM
process wont die Axion Linux - Software 5 01-01-2004 01:23 PM
not logged in but session wont die! tig_grrrrr Linux - General 2 07-09-2003 10:56 AM
Killing a thread that wont die nephi Linux - General 2 03-21-2003 08:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:11 AM.

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