The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Special Forums > Filesystems, Disks and Memory
Google UNIX.COM
Home Forums Register Rules & FAQ Members List Arcade Search Today's Posts Mark Forums Read


Filesystems, Disks and Memory Questions involving NAS, SAN, RAID, Robotic Libraries, backups, etc go here.


Other UNIX.COM Threads You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
list files commands lweegp Shell Programming and Scripting 12 04-17-2008 01:18 AM
troublesooting commands/files melanie_pfefer Linux 2 04-07-2008 08:34 AM
To delete files Pradeep.P. Shell Programming and Scripting 3 11-29-2006 09:46 PM
when I try to run rm on multiple files I have problem to delete files with space umen UNIX for Dummies Questions & Answers 1 09-20-2005 12:20 AM
"nohup" and "&" commands xadamz23 UNIX for Dummies Questions & Answers 1 08-12-2003 01:31 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-06-2007
Registered User
 

Join Date: Sep 2005
Posts: 10
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
killing nohup commands delete files?

Hello,

I just want to ask if killing a specific procees might delete files being read of that process?

Here is the scenario: I execute nohup find . -type f |xargs ls -lrt > nohup1.out &

I noticed that it is taking so much space, I check that there are files so huge
.nfs* and keep on growing, I use fuser command to check what processes using that file and kill them all. The free space increases. I'm suspecting that it also checked other mountpoints so it runs forever.

I am not sure that killing those processes and removing those .nfs* has the possibility that it also delete files as well as directories. The command is just ls -lrt. Let me know if that is a possiblity.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 07-10-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
Quote:
Originally Posted by james_falco View Post
I just want to ask if killing a specific procees might delete files being read of that process?
No, however a program may create temporary files which it may then clean up on exit.

All that the operating system does with a killed process is to close it's open files.
Reply With Quote
  #3 (permalink)  
Old 07-10-2007
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,206
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
But closing a file may indeed delete it. We get this question quite a bit. Someone will do something like:
yes > really.big.file &
and observe that really.big.file has consumed all of the disk space in a filesystems. They then do "rm really.big.file" and post a question wondering why the space was not freed. The rm command simply removes the lasy hard link to the file. But the file is still open so the space will not be freed. The space will be freed when the last process that has it open finally closes it.

A more complex situation arises when two processes on a single NFS client open a file on a NFS server. Should one of the processes wish to delete the file, the client code will detect that a second process has it open. To perserve the integrity of the filehandle the client will rename the file to a hidden name and with most implementations, .nfsnnnnn is the name that is used. When the last process on the NFS client closes the file, the NFS client code will indeed delete the .nfsnnnnn file. This is not a super robust solution and it screws up if multiple processes have the file opened on different NFS clients, and this will usually result in stale filehandles. But I'm just the messenger.
Reply With Quote
Google UNIX.COM
Reply



Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -7. The time now is 02:34 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger

Search Engine Optimization by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102